Better support for LLVM linking, needed for static OSL library.

This adds cmake code for LLVM on linux and updates the cmake code used for OSX.
LLVM is linked like other external libraries now, by using the setup_liblinks and setup_libdirs macros instead of the PLATFORM_LINKFLAGS variable.
The use of llvm-config for getting a list of libraries can also be simplified quite a bit.

Caching the LLVM_DIRECTORY and LLVM_VERSION strings could be nicer though.
This commit is contained in:
Lukas Toenne
2012-10-06 11:00:45 +00:00
parent c001bd81a7
commit a2d8cf333f
2 changed files with 120 additions and 60 deletions

View File

@@ -244,6 +244,9 @@ macro(SETUP_LIBDIRS)
link_directories(${PCRE_LIBPATH})
link_directories(${EXPAT_LIBPATH})
endif()
if(WITH_LLVM)
link_directories(${LLVM_LIB_DIR})
endif()
if(WITH_MEM_JEMALLOC)
link_directories(${JEMALLOC_LIBPATH})
endif()
@@ -382,6 +385,9 @@ macro(setup_liblinks
if(WITH_CYCLES_OSL)
target_link_libraries(${target} ${OSL_LIBRARIES})
endif()
if(WITH_LLVM)
target_link_libraries(${target} ${LLVM_LIBRARY})
endif()
if(WIN32 AND NOT UNIX)
target_link_libraries(${target} ${PTHREADS_LIBRARIES})
endif()