summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-07-24 11:41:58 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-08 17:24:00 +0200
commitc06629773b1acb6a78bc5903d16a967e751ce739 (patch)
tree0ca1576f2274ecd8e6c54e492545cce4fbe0af2d
parent9e29f23cc3afcd33c4735a397ca94b5d7bed3326 (diff)
cmake: add opton to link against LLVM's libc++
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/CMakeLists.txt6
2 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5d38309..a7382f0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,4 +52,6 @@ endif()
set(SANITIZER_MODE "none" CACHE STRING "Build using a specific sanitizer (e.g. 'address', 'thread', 'leak', 'undefined'), depends on compiler; default none")
+set(LINK_LIBCXX OFF CACHE BOOL "Link against LLVMs libc++")
+
add_subdirectory(src)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ebb1946..f2c9b3a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -65,6 +65,12 @@ set_target_properties(winman
LINK_FLAGS "-Wl,--version-script=../../export.map")
+if (LINK_LIBCXX)
+ set_target_properties(winman
+ PROPERTIES
+ LINK_FLAGS "-Wl,--version-script=../../export.map -lc++")
+endif()
+
if (NOT ${SANITIZER_MODE} STREQUAL "none" AND NOT ${SANITIZER_MODE} STREQUAL "")
target_compile_options(winman
PRIVATE