forked from OSchip/llvm-project
Link LLVM libraries into libLLVMPolly if BUILD_SHARED_LIBS=ON is set
Without this change we get linker errors such as: undefined reference to `llvm::dbgs()' We only conditionally link in these libraries, as in BUILD_SHARED_LIBS=OFF mode, linking in these libraries causes such functions (and especially global options) to be defined twice. The "solution" I choose is most likely not ideal, but seems to work. If any cmake specialist can suggest a better approach, this would be appreciated. We also drop a .c file that is not needed as it caused linker errors as well. llvm-svn: 228914
This commit is contained in:
parent
24433a7005
commit
cf33c93bd4
|
@ -91,7 +91,6 @@ set (ISL_FILES
|
|||
External/isl/print.c
|
||||
External/isl/imath/gmp_compat.c
|
||||
External/isl/imath/imath.c
|
||||
External/isl/imath/imdrover.c
|
||||
External/isl/imath/imrat.c
|
||||
External/isl/imath/iprime.c
|
||||
External/isl/imath/pi.c
|
||||
|
@ -129,6 +128,18 @@ add_polly_library(Polly
|
|||
${ISL_FILES}
|
||||
)
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
target_link_libraries(Polly
|
||||
LLVMSupport
|
||||
LLVMCore
|
||||
LLVMScalarOpts
|
||||
LLVMInstCombine
|
||||
LLVMTransformUtils
|
||||
LLVMAnalysis
|
||||
LLVMipo
|
||||
)
|
||||
endif()
|
||||
|
||||
# Build a monolithic Polly.a and a thin module LLVMPolly.moduleext that links to
|
||||
# that static library.
|
||||
add_polly_loadable_module(LLVMPolly
|
||||
|
|
Loading…
Reference in New Issue