diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-10-06 15:00:45 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-10-06 15:00:45 +0400 |
commit | a2d8cf333fb61de97270c1dce732a72915f20dd4 (patch) | |
tree | e79424516a50543686597949ace1cc10b72c6814 /build_files/cmake/macros.cmake | |
parent | c001bd81a75b60a491ae30947736eea78260827a (diff) |
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.
Diffstat (limited to 'build_files/cmake/macros.cmake')
-rw-r--r-- | build_files/cmake/macros.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 43cfb31c03c..750903b12d7 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -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() |