From b4700e4eed73467acdceb4a343f83f718b054954 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Tue, 29 Jul 2014 18:25:57 -0700 Subject: [PATCH] chore(build): eliminate artificial dependencies Signed-off-by: Leonardo de Moura --- src/CMakeLists.txt | 2 +- src/shell/CMakeLists.txt | 2 +- src/tests/frontends/lean/CMakeLists.txt | 6 +-- src/tests/kernel/CMakeLists.txt | 16 ++++---- src/tests/library/CMakeLists.txt | 10 ++--- src/tests/util/CMakeLists.txt | 54 ++++++++++++------------- src/tests/util/interval/CMakeLists.txt | 8 ++-- src/tests/util/numerics/CMakeLists.txt | 22 +++++----- 8 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 97f6dc359..e2060a542 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -262,7 +262,7 @@ if(("${MULTI_THREAD}" MATCHES "ON") AND (NOT (("${CMAKE_SYSTEM_NAME}" MATCHES "D set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread") endif() set(CMAKE_EXE_LINKER_FLAGS_TESTCOV "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") -set(EXTRA_LIBS ${LEAN_LIBS} ${EXTRA_LIBS}) +set(ALL_LIBS ${LEAN_LIBS} ${EXTRA_LIBS}) add_subdirectory(shell) add_subdirectory(emacs) diff --git a/src/shell/CMakeLists.txt b/src/shell/CMakeLists.txt index 4583e6fec..2159189ec 100644 --- a/src/shell/CMakeLists.txt +++ b/src/shell/CMakeLists.txt @@ -1,5 +1,5 @@ add_executable(lean lean.cpp) -target_link_libraries(lean ${EXTRA_LIBS}) +target_link_libraries(lean ${ALL_LIBS}) ADD_CUSTOM_COMMAND(TARGET lean POST_BUILD diff --git a/src/tests/frontends/lean/CMakeLists.txt b/src/tests/frontends/lean/CMakeLists.txt index 94305a8b7..1c7e1147c 100644 --- a/src/tests/frontends/lean/CMakeLists.txt +++ b/src/tests/frontends/lean/CMakeLists.txt @@ -1,9 +1,9 @@ add_executable(lean_scanner scanner.cpp) -target_link_libraries(lean_scanner ${EXTRA_LIBS}) +target_link_libraries(lean_scanner "lean_frontend;library;kernel;util;${EXTRA_LIBS}") add_test(lean_scanner ${CMAKE_CURRENT_BINARY_DIR}/lean_scanner) # add_executable(lean_parser parser.cpp) -# target_link_libraries(lean_parser ${EXTRA_LIBS}) +# target_link_libraries(lean_parser ${ALL_LIBS}) # add_test(lean_parser ${CMAKE_CURRENT_BINARY_DIR}/lean_parser) # # add_executable(lean_pp pp.cpp) -# target_link_libraries(lean_pp ${EXTRA_LIBS}) +# target_link_libraries(lean_pp ${ALL_LIBS}) # add_test(lean_pp ${CMAKE_CURRENT_BINARY_DIR}/lean_pp) diff --git a/src/tests/kernel/CMakeLists.txt b/src/tests/kernel/CMakeLists.txt index cfde1f1bb..d359553ec 100644 --- a/src/tests/kernel/CMakeLists.txt +++ b/src/tests/kernel/CMakeLists.txt @@ -1,24 +1,24 @@ add_executable(level level.cpp) -target_link_libraries(level ${EXTRA_LIBS}) +target_link_libraries(level "library;kernel;util;${EXTRA_LIBS}") add_test(level ${CMAKE_CURRENT_BINARY_DIR}/level) add_executable(expr expr.cpp) -target_link_libraries(expr ${EXTRA_LIBS}) +target_link_libraries(expr "library;kernel;util;${EXTRA_LIBS}") add_test(expr ${CMAKE_CURRENT_BINARY_DIR}/expr) add_executable(max_sharing max_sharing.cpp) -target_link_libraries(max_sharing ${EXTRA_LIBS}) +target_link_libraries(max_sharing "kernel;library;util;${EXTRA_LIBS}") add_test(max_sharing ${CMAKE_CURRENT_BINARY_DIR}/max_sharing) add_executable(free_vars free_vars.cpp) -target_link_libraries(free_vars ${EXTRA_LIBS}) +target_link_libraries(free_vars "kernel;util;${EXTRA_LIBS}") add_test(free_vars ${CMAKE_CURRENT_BINARY_DIR}/free_vars) add_executable(replace replace.cpp) -target_link_libraries(replace ${EXTRA_LIBS}) +target_link_libraries(replace "kernel;util;${EXTRA_LIBS}") add_test(replace ${CMAKE_CURRENT_BINARY_DIR}/replace) add_executable(environment environment.cpp) -target_link_libraries(environment ${EXTRA_LIBS}) +target_link_libraries(environment "kernel;util;${EXTRA_LIBS}") add_test(environment ${CMAKE_CURRENT_BINARY_DIR}/environment) add_executable(metavar metavar.cpp) -target_link_libraries(metavar ${EXTRA_LIBS}) +target_link_libraries(metavar "kernel;util;${EXTRA_LIBS}") add_test(metavar ${CMAKE_CURRENT_BINARY_DIR}/metavar) add_executable(instantiate instantiate.cpp) -target_link_libraries(instantiate ${EXTRA_LIBS}) +target_link_libraries(instantiate "kernel;util;${EXTRA_LIBS}") add_test(instantiate ${CMAKE_CURRENT_BINARY_DIR}/instantiate) diff --git a/src/tests/library/CMakeLists.txt b/src/tests/library/CMakeLists.txt index 815e6f7b3..053b966bd 100644 --- a/src/tests/library/CMakeLists.txt +++ b/src/tests/library/CMakeLists.txt @@ -1,15 +1,15 @@ add_executable(expr_lt expr_lt.cpp) -target_link_libraries(expr_lt ${EXTRA_LIBS}) +target_link_libraries(expr_lt "library;kernel;util;${EXTRA_LIBS}") add_test(expr_lt ${CMAKE_CURRENT_BINARY_DIR}/expr_lt) add_executable(deep_copy deep_copy.cpp) -target_link_libraries(deep_copy ${EXTRA_LIBS}) +target_link_libraries(deep_copy "library;kernel;util;${EXTRA_LIBS}") add_test(deep_copy ${CMAKE_CURRENT_BINARY_DIR}/deep_copy) add_executable(occurs occurs.cpp) -target_link_libraries(occurs ${EXTRA_LIBS}) +target_link_libraries(occurs "library;kernel;util;${EXTRA_LIBS}") add_test(occurs ${CMAKE_CURRENT_BINARY_DIR}/occurs) add_executable(unifier unifier.cpp) -target_link_libraries(unifier ${EXTRA_LIBS}) +target_link_libraries(unifier "library;kernel;util;${EXTRA_LIBS}") add_test(unifier ${CMAKE_CURRENT_BINARY_DIR}/unifier) add_executable(head_map head_map.cpp) -target_link_libraries(head_map ${EXTRA_LIBS}) +target_link_libraries(head_map "library;kernel;util;${EXTRA_LIBS}") add_test(head_map ${CMAKE_CURRENT_BINARY_DIR}/head_map) diff --git a/src/tests/util/CMakeLists.txt b/src/tests/util/CMakeLists.txt index 33b971353..1e3ab1f94 100644 --- a/src/tests/util/CMakeLists.txt +++ b/src/tests/util/CMakeLists.txt @@ -1,80 +1,80 @@ add_executable(name name.cpp) -target_link_libraries(name ${EXTRA_LIBS}) +target_link_libraries(name "util;${EXTRA_LIBS}") add_test(name ${CMAKE_CURRENT_BINARY_DIR}/name) add_executable(sexpr_tst sexpr.cpp) -target_link_libraries(sexpr_tst ${EXTRA_LIBS}) +target_link_libraries(sexpr_tst "util;numerics;sexpr;${EXTRA_LIBS}") add_test(sexpr ${CMAKE_CURRENT_BINARY_DIR}/sexpr_tst) add_executable(format format.cpp) -target_link_libraries(format ${EXTRA_LIBS}) +target_link_libraries(format "util;numerics;sexpr;${EXTRA_LIBS}") add_test(format ${CMAKE_CURRENT_BINARY_DIR}/format) add_executable(buffer buffer.cpp) -target_link_libraries(buffer ${EXTRA_LIBS}) +target_link_libraries(buffer "util;${EXTRA_LIBS}") add_test(buffer ${CMAKE_CURRENT_BINARY_DIR}/buffer) add_executable(list list.cpp) -target_link_libraries(list ${EXTRA_LIBS}) +target_link_libraries(list "util;${EXTRA_LIBS}") add_test(list ${CMAKE_CURRENT_BINARY_DIR}/list) add_executable(scoped_set scoped_set.cpp) -target_link_libraries(scoped_set ${EXTRA_LIBS}) +target_link_libraries(scoped_set "util;${EXTRA_LIBS}") add_test(scoped_set ${CMAKE_CURRENT_BINARY_DIR}/scoped_set) add_executable(options options.cpp) -target_link_libraries(options ${EXTRA_LIBS}) +target_link_libraries(options "util;numerics;sexpr;${EXTRA_LIBS}") add_test(options ${CMAKE_CURRENT_BINARY_DIR}/options) add_executable(scoped_map scoped_map.cpp) -target_link_libraries(scoped_map ${EXTRA_LIBS}) +target_link_libraries(scoped_map "util;${EXTRA_LIBS}") add_test(scoped_map ${CMAKE_CURRENT_BINARY_DIR}/scoped_map) add_executable(memory memory.cpp) -target_link_libraries(memory ${EXTRA_LIBS}) +target_link_libraries(memory "util;${EXTRA_LIBS}") add_test(memory ${CMAKE_CURRENT_BINARY_DIR}/memory) add_executable(rb_tree rb_tree.cpp) -target_link_libraries(rb_tree ${EXTRA_LIBS}) +target_link_libraries(rb_tree "util;${EXTRA_LIBS}") add_test(rb_tree ${CMAKE_CURRENT_BINARY_DIR}/rb_tree) add_executable(rb_map rb_map.cpp) -target_link_libraries(rb_map ${EXTRA_LIBS}) +target_link_libraries(rb_map "util;${EXTRA_LIBS}") add_test(rb_map ${CMAKE_CURRENT_BINARY_DIR}/rb_map) add_executable(splay_tree splay_tree.cpp) -target_link_libraries(splay_tree ${EXTRA_LIBS}) +target_link_libraries(splay_tree "util;${EXTRA_LIBS}") add_test(splay_tree ${CMAKE_CURRENT_BINARY_DIR}/splay_tree) add_executable(splay_map splay_map.cpp) -target_link_libraries(splay_map ${EXTRA_LIBS}) +target_link_libraries(splay_map "util;${EXTRA_LIBS}") add_test(splay_map ${CMAKE_CURRENT_BINARY_DIR}/splay_map) add_executable(trace trace.cpp) -target_link_libraries(trace ${EXTRA_LIBS}) +target_link_libraries(trace "util;${EXTRA_LIBS}") add_test(trace ${CMAKE_CURRENT_BINARY_DIR}/trace) add_executable(exception exception.cpp) -target_link_libraries(exception ${EXTRA_LIBS}) +target_link_libraries(exception "util;${EXTRA_LIBS}") add_test(exception ${CMAKE_CURRENT_BINARY_DIR}/exception) add_executable(bit_tricks bit_tricks.cpp) -target_link_libraries(bit_tricks ${EXTRA_LIBS}) +target_link_libraries(bit_tricks "util;${EXTRA_LIBS}") add_test(bit_tricks ${CMAKE_CURRENT_BINARY_DIR}/bit_tricks) add_executable(lazy_list lazy_list.cpp) -target_link_libraries(lazy_list ${EXTRA_LIBS}) +target_link_libraries(lazy_list "util;numerics;${EXTRA_LIBS}") add_test(lazy_list ${CMAKE_CURRENT_BINARY_DIR}/lazy_list) add_executable(hash hash.cpp) -target_link_libraries(hash ${EXTRA_LIBS}) +target_link_libraries(hash "util;${EXTRA_LIBS}") add_test(hash ${CMAKE_CURRENT_BINARY_DIR}/hash) add_executable(safe_arith safe_arith.cpp) -target_link_libraries(safe_arith ${EXTRA_LIBS}) +target_link_libraries(safe_arith "util;${EXTRA_LIBS}") add_test(safe_arith ${CMAKE_CURRENT_BINARY_DIR}/safe_arith) add_executable(set set.cpp) -target_link_libraries(set ${EXTRA_LIBS}) +target_link_libraries(set "util;${EXTRA_LIBS}") add_test(set ${CMAKE_CURRENT_BINARY_DIR}/set) add_executable(optional optional.cpp) -target_link_libraries(optional ${EXTRA_LIBS}) +target_link_libraries(optional "util;${EXTRA_LIBS}") add_test(optional ${CMAKE_CURRENT_BINARY_DIR}/optional) add_executable(stackinfo stackinfo.cpp) -target_link_libraries(stackinfo ${EXTRA_LIBS}) +target_link_libraries(stackinfo "util;${EXTRA_LIBS}") add_test(stackinfo ${CMAKE_CURRENT_BINARY_DIR}/stackinfo) add_executable(serializer serializer.cpp) -target_link_libraries(serializer ${EXTRA_LIBS}) +target_link_libraries(serializer "util;${EXTRA_LIBS}") add_test(serializer ${CMAKE_CURRENT_BINARY_DIR}/serializer) add_executable(trie trie.cpp) -target_link_libraries(trie ${EXTRA_LIBS}) +target_link_libraries(trie "util;${EXTRA_LIBS}") add_test(trie ${CMAKE_CURRENT_BINARY_DIR}/trie) add_executable(lru_cache lru_cache.cpp) -target_link_libraries(lru_cache ${EXTRA_LIBS}) +target_link_libraries(lru_cache "util;${EXTRA_LIBS}") add_test(lru_cache ${CMAKE_CURRENT_BINARY_DIR}/lru_cache) add_executable(worker_queue worker_queue.cpp) -target_link_libraries(worker_queue ${EXTRA_LIBS}) +target_link_libraries(worker_queue "util;${EXTRA_LIBS}") add_test(worker_queue ${CMAKE_CURRENT_BINARY_DIR}/worker_queue) # thread.cpp used import_test.lua add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/import_test.lua @@ -82,6 +82,6 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/import_test.lua DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/import_test.lua) add_custom_target("import_test" DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/import_test.lua) add_executable(thread thread.cpp) -target_link_libraries(thread ${EXTRA_LIBS}) +target_link_libraries(thread "util;${EXTRA_LIBS}") add_test(thread ${CMAKE_CURRENT_BINARY_DIR}/thread) add_dependencies(thread import_test) \ No newline at end of file diff --git a/src/tests/util/interval/CMakeLists.txt b/src/tests/util/interval/CMakeLists.txt index 54967d59a..4a3acfe6d 100644 --- a/src/tests/util/interval/CMakeLists.txt +++ b/src/tests/util/interval/CMakeLists.txt @@ -1,15 +1,15 @@ add_executable(interval_tst interval.cpp) -target_link_libraries(interval_tst ${EXTRA_LIBS}) +target_link_libraries(interval_tst "interval;numerics;util;${EXTRA_LIBS}") add_test(basic_interval ${CMAKE_CURRENT_BINARY_DIR}/interval_tst) add_executable(float_interval_tst float_interval.cpp) -target_link_libraries(float_interval_tst ${EXTRA_LIBS}) +target_link_libraries(float_interval_tst "interval;numerics;util;${EXTRA_LIBS}") add_test(float_interval ${CMAKE_CURRENT_BINARY_DIR}/float_interval_tst) add_executable(double_interval_tst double_interval.cpp) -target_link_libraries(double_interval_tst ${EXTRA_LIBS}) +target_link_libraries(double_interval_tst "interval;numerics;util;${EXTRA_LIBS}") add_test(double_interval ${CMAKE_CURRENT_BINARY_DIR}/double_interval_tst) add_executable(mpfp_interval_tst mpfp_interval.cpp) -target_link_libraries(mpfp_interval_tst ${EXTRA_LIBS}) +target_link_libraries(mpfp_interval_tst "interval;numerics;util;${EXTRA_LIBS}") add_test(mpfp_interval ${CMAKE_CURRENT_BINARY_DIR}/mpfp_interval_tst) diff --git a/src/tests/util/numerics/CMakeLists.txt b/src/tests/util/numerics/CMakeLists.txt index 13247a787..a6e286af4 100644 --- a/src/tests/util/numerics/CMakeLists.txt +++ b/src/tests/util/numerics/CMakeLists.txt @@ -1,33 +1,33 @@ add_executable(mpq mpq.cpp) -target_link_libraries(mpq ${EXTRA_LIBS}) +target_link_libraries(mpq "numerics;util;${EXTRA_LIBS}") add_test(mpq ${CMAKE_CURRENT_BINARY_DIR}/mpq) add_executable(mpbq mpbq.cpp) -target_link_libraries(mpbq ${EXTRA_LIBS}) +target_link_libraries(mpbq "numerics;util;${EXTRA_LIBS}") add_test(mpbq ${CMAKE_CURRENT_BINARY_DIR}/mpbq) add_executable(mpfp mpfp.cpp) -target_link_libraries(mpfp ${EXTRA_LIBS}) +target_link_libraries(mpfp "numerics;util;${EXTRA_LIBS}") add_test(mpfp ${CMAKE_CURRENT_BINARY_DIR}/mpfp) add_executable(mpz mpz.cpp) -target_link_libraries(mpz ${EXTRA_LIBS}) +target_link_libraries(mpz "numerics;util;${EXTRA_LIBS}") add_test(mpz ${CMAKE_CURRENT_BINARY_DIR}/mpz) add_executable(double double.cpp) -target_link_libraries(double ${EXTRA_LIBS}) +target_link_libraries(double "numerics;util;${EXTRA_LIBS}") add_test(double ${CMAKE_CURRENT_BINARY_DIR}/double) add_executable(float float.cpp) -target_link_libraries(float ${EXTRA_LIBS}) +target_link_libraries(float "numerics;util;${EXTRA_LIBS}") add_test(float ${CMAKE_CURRENT_BINARY_DIR}/float) add_executable(xnumeral xnumeral.cpp) -target_link_libraries(xnumeral ${EXTRA_LIBS}) +target_link_libraries(xnumeral "numerics;util;${EXTRA_LIBS}") add_test(xnumeral ${CMAKE_CURRENT_BINARY_DIR}/xnumeral) add_executable(primes primes.cpp) -target_link_libraries(primes ${EXTRA_LIBS}) +target_link_libraries(primes "numerics;util;${EXTRA_LIBS}") add_test(primes ${CMAKE_CURRENT_BINARY_DIR}/primes) add_executable(numeric_traits numeric_traits.cpp) -target_link_libraries(numeric_traits ${EXTRA_LIBS}) +target_link_libraries(numeric_traits "numerics;util;${EXTRA_LIBS}") add_test(numeric_traits ${CMAKE_CURRENT_BINARY_DIR}/numeric_traits) add_executable(gcd gcd.cpp) -target_link_libraries(gcd ${EXTRA_LIBS}) +target_link_libraries(gcd "numerics;util;${EXTRA_LIBS}") add_test(gcd ${CMAKE_CURRENT_BINARY_DIR}/gcd) add_executable(zpz zpz.cpp) -target_link_libraries(zpz ${EXTRA_LIBS}) +target_link_libraries(zpz "numerics;util;${EXTRA_LIBS}") add_test(zpz ${CMAKE_CURRENT_BINARY_DIR}/zpz)