diff options
author | Jens Verwiebe <info@jensverwiebe.de> | 2014-08-06 14:48:06 +0400 |
---|---|---|
committer | Jens Verwiebe <info@jensverwiebe.de> | 2014-08-06 14:48:06 +0400 |
commit | 7ae187c5e42dd5de6dda59aae8d87f48df308195 (patch) | |
tree | 06ff7d9d5ac27903830feb1fbf03e43e869e7674 | |
parent | 9ece95de48cc89f6b4bae5fe0ebd2cbba6f134ff (diff) |
OSX/cmake: allow for llvm dynamic builds too, but prefer static
-rw-r--r-- | CMakeLists.txt | 9 | ||||
-rw-r--r-- | source/creator/CMakeLists.txt | 7 |
2 files changed, 14 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4349105929d..98115e08d60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -283,7 +283,11 @@ unset(PLATFORM_DEFAULT) # LLVM option(WITH_LLVM "Use LLVM" OFF) -option(LLVM_STATIC "Link with LLVM static libraries" OFF) +if(APPLE) + option(LLVM_STATIC "Link with LLVM static libraries" ON) # we prefer static llvm build on Apple, dyn build possible though +else() + option(LLVM_STATIC "Link with LLVM static libraries" OFF) +endif() mark_as_advanced(LLVM_STATIC) # disable for now, but plan to support on all platforms eventually @@ -1862,7 +1866,6 @@ elseif(APPLE) endif() if(WITH_LLVM) - set(LLVM_STATIC ON CACHE BOOL "ON" FORCE) # we use always the static libs default, else gives linking errors set(LLVM_DIRECTORY ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation") set(LLVM_VERSION "3.4" CACHE STRING "Version of LLVM to use") if(EXISTS "${LLVM_DIRECTORY}/bin/llvm-config") @@ -1892,6 +1895,8 @@ elseif(APPLE) OUTPUT_VARIABLE LLVM_LIBRARY OUTPUT_STRIP_TRAILING_WHITESPACE) string(REPLACE " " ";" LLVM_LIBRARY ${LLVM_LIBRARY}) + else() + set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -lLLVM-3.4") endif() else() message(FATAL_ERROR "LLVM not found.") diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index bd9fc90abaf..e427fff0e02 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -826,6 +826,13 @@ elseif(APPLE) ) endif() + if(WITH_LLVM AND NOT LLVM_STATIC) + install( + FILES ${LIBDIR}/llvm/lib/libLLVM-3.4.dylib + DESTINATION ${TARGETDIR}/blender.app/Contents/MacOS + ) + endif() + # python if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK) # the python zip is first extract as part of the build process, |