chore(builtin): cleanup dependencies

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-12-30 12:40:42 -08:00
parent a80fccea93
commit a017801983
2 changed files with 13 additions and 21 deletions

View file

@ -31,7 +31,7 @@ function(add_theory_core FILE ARG EXTRA_DEPS)
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${FNAME} ${SHELL_DIR}/${FNAME} COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${FNAME} ${SHELL_DIR}/${FNAME}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${FNAME} ${CMAKE_CURRENT_SOURCE_DIR}/${FNAME} COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${FNAME} ${CMAKE_CURRENT_SOURCE_DIR}/${FNAME}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${SHELL_DIR}/lean ${EXTRA_DEPS}) DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${FILE} ${SHELL_DIR}/lean ${EXTRA_DEPS})
add_custom_target("${BASENAME}_builtin" DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FNAME}) add_custom_target("${BASENAME}_builtin" DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${FNAME} ${EXTRA_DEPS})
add_dependencies(builtin ${BASENAME}_builtin) add_dependencies(builtin ${BASENAME}_builtin)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${FNAME} DESTINATION library) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${FNAME} DESTINATION library)
endfunction() endfunction()
@ -50,35 +50,27 @@ function(copy_olean FILE)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${FNAME} DESTINATION library) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${FNAME} DESTINATION library)
endfunction() endfunction()
function(add_kernel_theory FILE) function(add_kernel_theory FILE DEPS)
if(CMAKE_CROSSCOMPILING) if(CMAKE_CROSSCOMPILING)
copy_olean(${FILE}) copy_olean(${FILE})
else() else()
add_theory_core(${FILE} "-n" "${CMAKE_CURRENT_BINARY_DIR}/macros.lua") add_theory_core(${FILE} "-n" "${DEPS}")
endif() endif()
endfunction() endfunction()
function(add_theory FILE) function(add_theory FILE DEPS)
if(CMAKE_CROSSCOMPILING) if(CMAKE_CROSSCOMPILING)
copy_olean(${FILE}) copy_olean(${FILE})
else() else()
add_theory_core(${FILE} "" "${CMAKE_CURRENT_BINARY_DIR}/kernel.olean") add_theory_core(${FILE} "" "${DEPS}")
endif() endif()
endfunction() endfunction()
add_kernel_theory("kernel.lean") add_kernel_theory("kernel.lean" "${CMAKE_CURRENT_BINARY_DIR}/macros.lua")
add_kernel_theory("nat.lean") add_kernel_theory("nat.lean" "${CMAKE_CURRENT_BINARY_DIR}/kernel.olean")
add_dependencies(nat_builtin kernel_builtin) add_kernel_theory("int.lean" "${CMAKE_CURRENT_BINARY_DIR}/nat.olean")
add_kernel_theory("int.lean") add_kernel_theory("real.lean" "${CMAKE_CURRENT_BINARY_DIR}/int.olean")
add_dependencies(int_builtin nat_builtin)
add_kernel_theory("real.lean") add_theory("specialfn.lean" "${CMAKE_CURRENT_BINARY_DIR}/real.olean")
add_dependencies(real_builtin int_builtin) add_theory("cast.lean" "${CMAKE_CURRENT_BINARY_DIR}/kernel.olean")
add_kernel_theory("specialfn.lean")
add_dependencies(specialfn_builtin real_builtin)
add_theory("cast.lean")
# TODO(Leo): Remove the following dependencies after cleanup
add_dependencies(cast_builtin kernel_builtin)
add_dependencies(cast_builtin nat_builtin)
add_dependencies(cast_builtin int_builtin)
add_dependencies(cast_builtin real_builtin)
add_dependencies(cast_builtin specialfn_builtin)

Binary file not shown.