Fix CMake configuration errors on OS X
authorEric Fiselier <eric@efcs.ca>
Sat, 4 Mar 2017 02:15:37 +0000 (02:15 +0000)
committerEric Fiselier <eric@efcs.ca>
Sat, 4 Mar 2017 02:15:37 +0000 (02:15 +0000)
llvm-svn: 296954

libcxxabi/CMakeLists.txt

index 81d4042..be76724 100644 (file)
@@ -416,13 +416,16 @@ if (LIBCXXABI_HAS_EXTERNAL_THREAD_API)
   endif()
 endif()
 
-set(LIBCXXABI_HAS_UNDEFINED_SYMBOLS ((NOT LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS)
-    OR (LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY AND LIBCXXABI_ENABLE_SHARED)))
+set(LIBCXXABI_HAS_UNDEFINED_SYMBOLS OFF)
+if ((NOT LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS)
+    OR (LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY AND LIBCXXABI_ENABLE_SHARED))
+  set(LIBCXXABI_HAS_UNDEFINED_SYMBOLS ON)
+endif()
 
 if (LIBCXXABI_HAS_UNDEFINED_SYMBOLS)
   # Need to allow unresolved symbols if this is to work with shared library builds
   if (APPLE)
-    add_link_flags("-undefined dynamic_lookup")
+    list(APPEND LIBCXXABI_LINK_FLAGS "-undefined dynamic_lookup")
   else()
     # Relax this restriction from HandleLLVMOptions
     string(REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")