[Bf-blender-cvs] [7ae187c] master: OSX/cmake: allow for llvm dynamic builds too, but prefer static

Jens Verwiebe noreply at git.blender.org
Wed Aug 6 12:48:25 CEST 2014


Commit: 7ae187c5e42dd5de6dda59aae8d87f48df308195
Author: Jens Verwiebe
Date:   Wed Aug 6 12:48:06 2014 +0200
Branches: master
https://developer.blender.org/rB7ae187c5e42dd5de6dda59aae8d87f48df308195

OSX/cmake: allow for llvm dynamic builds too, but prefer static

===================================================================

M	CMakeLists.txt
M	source/creator/CMakeLists.txt

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4349105..98115e0 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 bd9fc90..e427fff 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,




More information about the Bf-blender-cvs mailing list