feat(build): copy extra files to bin directory
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
e91fdaed00
commit
84c984a435
2 changed files with 17 additions and 3 deletions
|
@ -14,8 +14,8 @@ option(SPLIT_STACK "SPLIT_STACK" OFF)
|
|||
option(READLINE "READLINE" OFF)
|
||||
|
||||
# Added for CTest
|
||||
INCLUDE(CTest)
|
||||
CONFIGURE_FILE(${LEAN_SOURCE_DIR}/CTestCustom.cmake.in
|
||||
include(CTest)
|
||||
configure_file(${LEAN_SOURCE_DIR}/CTestCustom.cmake.in
|
||||
${LEAN_BINARY_DIR}/CTestCustom.cmake @ONLY)
|
||||
|
||||
set(LEAN_EXTRA_LINKER_FLAGS "")
|
||||
|
@ -217,6 +217,7 @@ endif()
|
|||
set(CMAKE_EXE_LINKER_FLAGS_TESTCOV "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
|
||||
set(EXTRA_LIBS ${LEAN_LIBS} ${EXTRA_LIBS})
|
||||
add_subdirectory(shell)
|
||||
|
||||
add_subdirectory(tests/util)
|
||||
add_subdirectory(tests/util/numerics)
|
||||
add_subdirectory(tests/util/interval)
|
||||
|
|
|
@ -4,6 +4,20 @@ add_executable(lean lean.cpp)
|
|||
add_dependencies(lean githash)
|
||||
target_link_libraries(lean ${EXTRA_LIBS})
|
||||
|
||||
function(add_extra_module indir)
|
||||
file(GLOB EXTRA_LUA_FILES "${LEAN_SOURCE_DIR}/extra/${indir}/*.lua")
|
||||
foreach(FILE ${EXTRA_LUA_FILES})
|
||||
get_filename_component(FNAME ${FILE} NAME)
|
||||
add_custom_command(OUTPUT ${LEAN_BINARY_DIR}/shell/${indir}/${FNAME}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${FILE} ${LEAN_BINARY_DIR}/shell/${indir}/${FNAME}
|
||||
MAIN_DEPENDENCY ${FILE})
|
||||
add_custom_target("${FNAME}_extra" DEPENDS ${LEAN_BINARY_DIR}/shell/${indir}/${FNAME})
|
||||
add_dependencies(lean "${FNAME}_extra")
|
||||
endforeach(FILE)
|
||||
endfunction()
|
||||
|
||||
add_extra_module(.)
|
||||
|
||||
add_test(example1_stdin1 ${LEAN_SOURCE_DIR}/cmake/redirect.sh ${CMAKE_CURRENT_BINARY_DIR}/lean "${LEAN_SOURCE_DIR}/../tests/lean/single.lean")
|
||||
add_test(example1_stdin2 ${LEAN_SOURCE_DIR}/cmake/redirect.sh ${CMAKE_CURRENT_BINARY_DIR}/lean "-l" "${LEAN_SOURCE_DIR}/../tests/lean/single.lean")
|
||||
add_test(example1_stdin3 ${LEAN_SOURCE_DIR}/cmake/redirect.sh ${CMAKE_CURRENT_BINARY_DIR}/lean "--lean" "${LEAN_SOURCE_DIR}/../tests/lean/single.lean")
|
||||
|
@ -23,7 +37,6 @@ add_test(lean_unknown_option ${LEAN_SOURCE_DIR}/cmake/check_failure.sh "${CMAKE_
|
|||
add_test(lean_unknown_file1 ${LEAN_SOURCE_DIR}/cmake/check_failure.sh "${CMAKE_CURRENT_BINARY_DIR}/lean" "boofoo.lean")
|
||||
add_test(lean_unknown_file2 ${LEAN_SOURCE_DIR}/cmake/check_failure.sh "${CMAKE_CURRENT_BINARY_DIR}/lean" "boofoo.lua")
|
||||
|
||||
|
||||
# LEAN EXAMPLES
|
||||
file(GLOB LEANEXAMPLES "${LEAN_SOURCE_DIR}/../examples/lean/*.lean")
|
||||
FOREACH(T ${LEANEXAMPLES})
|
||||
|
|
Loading…
Reference in a new issue