about summary refs log tree commit diff homepage
path: root/lib/Core
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2016-11-18 18:18:58 +0000
committerDan Liew <delcypher@gmail.com>2016-11-18 21:01:20 +0000
commitdda296e09ee53ed85ccf1c3f08e7e809adce612e (patch)
treec53130ee61c9b65b95d8507a8e5902aff56151a9 /lib/Core
parent82ab37990126ac9501d5775c2257ae4314986016 (diff)
downloadklee-dda296e09ee53ed85ccf1c3f08e7e809adce612e.tar.gz
[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.
Diffstat (limited to 'lib/Core')
-rw-r--r--lib/Core/CMakeLists.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/Core/CMakeLists.txt b/lib/Core/CMakeLists.txt
index 05e2cffa..79c529d0 100644
--- a/lib/Core/CMakeLists.txt
+++ b/lib/Core/CMakeLists.txt
@@ -27,3 +27,28 @@ klee_add_component(kleeCore
 	TimingSolver.cpp
 	UserSearcher.cpp
 )
+
+# TODO: Work out what the correct LLVM components are for
+# kleeCore.
+set(LLVM_COMPONENTS
+  core
+  support
+)
+
+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()
+
+
+klee_get_llvm_libs(LLVM_LIBS ${LLVM_COMPONENTS})
+target_link_libraries(kleeCore PUBLIC ${LLVM_LIBS})
+target_link_libraries(kleeCore PRIVATE
+  kleeBasic
+  kleeModule
+  kleaverSolver
+  kleaverExpr
+  kleeSupport
+)