cmake: add opton to link against LLVM's libc++
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>
Mon, 24 Jul 2017 09:41:58 +0000 (11:41 +0200)
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>
Tue, 8 Aug 2017 15:24:00 +0000 (17:24 +0200)
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
CMakeLists.txt
src/CMakeLists.txt

index 5d38309..a7382f0 100644 (file)
@@ -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)
index ebb1946..f2c9b3a 100644 (file)
@@ -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