cmake: Add additional libraries to fix the darwin shared library build
authorTobias Grosser <tobias@grosser.es>
Sun, 31 Jan 2016 20:25:46 +0000 (20:25 +0000)
committerTobias Grosser <tobias@grosser.es>
Sun, 31 Jan 2016 20:25:46 +0000 (20:25 +0000)
darwin requires the additional linkages of...

LLVMBitReader
LLVMMCParser
LLVMObject
LLVMProfileData
LLVMTarget
LLVMVectorize

as the darwin requires all of the weak undefined symbols in a library to be
resolved when linking it against an executable (unless
-Wl,-undefined,dynamic_lookup is used to override the default behavior of
-Wl,-undefined,error).

Contributed-by: Jack Howarth
llvm-svn: 259332

polly/lib/CMakeLists.txt

index 51c2824..371b97a 100644 (file)
@@ -66,6 +66,13 @@ if (BUILD_SHARED_LIBS)
     LLVMAnalysis
     LLVMipo
     LLVMMC
+# The libraries below are required for darwin: http://PR26392
+    LLVMBitReader
+    LLVMMCParser
+    LLVMObject
+    LLVMProfileData
+    LLVMTarget
+    LLVMVectorize
   )
   link_directories(
     ${LLVM_LIBRARY_DIR}