From dda296e09ee53ed85ccf1c3f08e7e809adce612e Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Fri, 18 Nov 2016 18:18:58 +0000 Subject: [CMake] Re-express LLVM and KLEE library dependencies as transitive dependencies on KLEE's libraries rather than on the final binaries. This is better because it means we can build other tools that use KLEE's libraries and not need to express the needed LLVM dependencies. It also makes it clearer what the dependencies are between KLEE libraries. This has illustrated a problem with the `kleeBasic` library. It contains `ConstructSolverChain.cpp` which clearly belongs in `kleaverSolver` not in `kleeBasic`. This will be fixed later. --- tools/kleaver/CMakeLists.txt | 7 ++++--- tools/klee/CMakeLists.txt | 28 +++------------------------- 2 files changed, 7 insertions(+), 28 deletions(-) (limited to 'tools') diff --git a/tools/kleaver/CMakeLists.txt b/tools/kleaver/CMakeLists.txt index befbcc6e..54452fff 100644 --- a/tools/kleaver/CMakeLists.txt +++ b/tools/kleaver/CMakeLists.txt @@ -10,9 +10,10 @@ add_executable(kleaver main.cpp ) -klee_get_llvm_libs(LLVM_LIBS support) -set(KLEE_LIBS kleeBasic kleaverSolver kleaverExpr kleeSupport) +set(KLEE_LIBS + kleaverSolver +) -target_link_libraries(kleaver ${KLEE_LIBS} ${LLVM_LIBS}) +target_link_libraries(kleaver ${KLEE_LIBS}) install(TARGETS kleaver RUNTIME DESTINATION bin) diff --git a/tools/klee/CMakeLists.txt b/tools/klee/CMakeLists.txt index 1f9fe63f..9c8c2192 100644 --- a/tools/klee/CMakeLists.txt +++ b/tools/klee/CMakeLists.txt @@ -10,33 +10,11 @@ add_executable(klee main.cpp ) -# FIXME: This shouldn't be done here. Instead the KLEE libraries -# should declare their LLVM dependencies. -set(LLVM_COMPONENTS - bitreader - bitwriter - ipo - linker - support +set(KLEE_LIBS + kleeCore ) -if ("${LLVM_PACKAGE_VERSION}" VERSION_EQUAL "3.6" OR - "${LLVM_PACKAGE_VERSION}" VERSION_GREATER "3.6") - list(APPEND LLVM_COMPONENTS mcjit executionengine native) -else() - list(APPEND LLVM_COMPONENTS jit engine) -endif() - -if ("${LLVM_PACKAGE_VERSION}" VERSION_EQUAL "3.3" OR - "${LLVM_PACKAGE_VERSION}" VERSION_GREATER "3.3") - list(APPEND LLVM_COMPONENTS irreader) -endif() - -klee_get_llvm_libs(LLVM_LIBS ${LLVM_COMPONENTS}) - -set(KLEE_LIBS kleeCore kleeBasic kleeModule kleaverSolver kleaverExpr kleeSupport) - -target_link_libraries(klee ${KLEE_LIBS} ${LLVM_LIBS}) +target_link_libraries(klee ${KLEE_LIBS}) install(TARGETS klee RUNTIME DESTINATION bin) -- cgit 1.4.1