about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2016-11-21 10:03:15 +0000
committerDan Liew <delcypher@gmail.com>2016-11-21 12:16:55 +0000
commitfb231a03349996cf995a0e6ff37432f77965e072 (patch)
tree7374efe7b179a3caeb46b698277420805905aa7b
parent7cfd25c0784fedfde7d2e8eaf0064437d6a0814b (diff)
downloadklee-fb231a03349996cf995a0e6ff37432f77965e072.tar.gz
[CMake] Fix the build when `-DBUILD_SHARED_LIBS=ON` is passed.
This fixes issue #507.

We can't build the components as shared libraries right now due
to cyclic dependencies (see #502 for a fix) and there are a few
other patches needed too (see #507).

Building the components as shared libraries isn't really desirable
anyway because it would require us to ship KLEE's libraries which
don't have a stable API.
-rw-r--r--cmake/klee_add_component.cmake4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmake/klee_add_component.cmake b/cmake/klee_add_component.cmake
index 28e271c5..ea1b30b2 100644
--- a/cmake/klee_add_component.cmake
+++ b/cmake/klee_add_component.cmake
@@ -8,7 +8,9 @@
 #===------------------------------------------------------------------------===#
 
 function(klee_add_component target_name)
-  add_library(${target_name} ${ARGN})
+  # Components are explicitly STATIC because we don't support building them
+  # as shared libraries.
+  add_library(${target_name} STATIC ${ARGN})
   # Use of `PUBLIC` means these will propagate to targets that use this component.
   if (("${CMAKE_VERSION}" VERSION_EQUAL "3.3") OR ("${CMAKE_VERSION}" VERSION_GREATER "3.3"))
     # In newer CMakes we can make sure that the flags are only used when compiling C++