about summary refs log tree commit diff homepage
path: root/runtime/klee-eh-cxx
diff options
context:
space:
mode:
authorMartin Nowack <m.nowack@imperial.ac.uk>2019-11-08 22:55:56 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2020-11-04 15:14:47 +0000
commit6156b4eeb9a429ccc370782d719d0d6c787a6f72 (patch)
tree71ca1ec35a44d8170798cf0dc44dd75f71d94040 /runtime/klee-eh-cxx
parent5b8e54a95bc2e1f373710aa62f5e6b70768555e7 (diff)
downloadklee-6156b4eeb9a429ccc370782d719d0d6c787a6f72.tar.gz
[cmake] Add support to generate arbitrary runtime library configurations
Every runtime library can be build with multiple configurations.

Replace the Makefile-based setup by cmake one.
Currently, we generate 32bit and 64bit libraries simultaneously and can link against them.
Diffstat (limited to 'runtime/klee-eh-cxx')
-rw-r--r--runtime/klee-eh-cxx/CMakeLists.txt24
-rw-r--r--runtime/klee-eh-cxx/Makefile.cmake.bitcode13
2 files changed, 24 insertions, 13 deletions
diff --git a/runtime/klee-eh-cxx/CMakeLists.txt b/runtime/klee-eh-cxx/CMakeLists.txt
new file mode 100644
index 00000000..e016757b
--- /dev/null
+++ b/runtime/klee-eh-cxx/CMakeLists.txt
@@ -0,0 +1,24 @@
+#===------------------------------------------------------------------------===#
+#
+#                     The KLEE Symbolic Virtual Machine
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+#===------------------------------------------------------------------------===#
+
+set(LIB_PREFIX "eh-cxx")
+set(SRC_FILES
+        klee_eh_cxx.cpp
+        )
+
+set(ADDITIONAL_CXX_FLAGS
+        -nostdinc++
+        -I "${KLEE_LIBCXXABI_SRC_DIR}/src"
+        -I "${KLEE_LIBCXXABI_SRC_DIR}/include"
+        -I "${KLEE_LIBCXX_INCLUDE_DIR}"
+        )
+# Build it
+include("${CMAKE_SOURCE_DIR}/cmake/compile_bitcode_library.cmake")
+prefix_with_path("${SRC_FILES}" "${CMAKE_CURRENT_SOURCE_DIR}/" prefixed_files)
+add_bitcode_library_targets("${LIB_PREFIX}" "${prefixed_files}" "" "${ADDITIONAL_CXX_FLAGS}")
\ No newline at end of file
diff --git a/runtime/klee-eh-cxx/Makefile.cmake.bitcode b/runtime/klee-eh-cxx/Makefile.cmake.bitcode
deleted file mode 100644
index aa314613..00000000
--- a/runtime/klee-eh-cxx/Makefile.cmake.bitcode
+++ /dev/null
@@ -1,13 +0,0 @@
-include ../Makefile.cmake.bitcode.config
-
-SRC_DIR=$(ROOT_SRC)/klee-eh-cxx
-
-ARCHIVE_FILE=$(ARCHIVE_DEST)/libklee-eh-cxx.bca
-
-all: $(ARCHIVE_FILE)
-
-klee_eh_cxx.bc: $(SRC_DIR)/klee_eh_cxx.cpp
-	$(LLVMCXX) -nostdinc++ -emit-llvm -c -I$(KLEE_INCLUDE_DIR) -I $(KLEE_LIBCXXABI_SRC_DIR)/src -I $(KLEE_LIBCXXABI_SRC_DIR)/include -I $(KLEE_LIBCXX_INCLUDE_DIR) $(SRC_DIR)/klee_eh_cxx.cpp -o $@
-
-$(ARCHIVE_FILE): klee_eh_cxx.bc
-	$(LLVM_AR) rcs $@ $<