Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2020-03-30 22:24:13 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-03-31 01:07:55 +0300
commitb555b8dedce058985bfe8c544c8c46ba4821bc1a (patch)
treeaf048cb1dcffe72fe096d3382259de47569d7dd7 /build_files
parent899bfdc412e413e6ab6121d822753bb3ea2df849 (diff)
Build: hide most symbols on macOS on Linux to avoid conflicts
This means symbols from Blender itself and most external libraries. We can't just hide all because that breaks some libraries. The better solution would be to rebuild all library dependencies with hidden visibility. Fixes T75223: Luxrender add-on failing to load on macOS
Diffstat (limited to 'build_files')
-rw-r--r--build_files/cmake/platform/platform_apple.cmake5
-rw-r--r--build_files/cmake/platform/platform_unix.cmake14
2 files changed, 11 insertions, 8 deletions
diff --git a/build_files/cmake/platform/platform_apple.cmake b/build_files/cmake/platform/platform_apple.cmake
index 11889fc7a87..620a078f412 100644
--- a/build_files/cmake/platform/platform_apple.cmake
+++ b/build_files/cmake/platform/platform_apple.cmake
@@ -449,10 +449,13 @@ if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)
# Xcode 5 is always using CLANG, which has too low template depth of 128 for libmv
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=1024")
endif()
-# Get rid of eventually clashes, we export some symbols explicitly as local
+
+# Avoid conflicts with Luxrender, and other plug-ins that may use the same
+# libraries as Blender with a different version or build options.
set(PLATFORM_LINKFLAGS
"${PLATFORM_LINKFLAGS} -Xlinker -unexported_symbols_list -Xlinker '${CMAKE_SOURCE_DIR}/source/creator/osx_locals.map'"
)
+set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -fvisibility=hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -stdlib=libc++")
diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake
index dcb6b9d34f9..c034e7028af 100644
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@ -405,13 +405,6 @@ if(WITH_LLVM)
endif()
endif()
-if(WITH_LLVM OR WITH_SDL_DYNLOAD)
- # Fix for conflict with Mesa llvmpipe
- set(PLATFORM_LINKFLAGS
- "${PLATFORM_LINKFLAGS} -Wl,--version-script='${CMAKE_SOURCE_DIR}/source/creator/blender.map'"
- )
-endif()
-
if(WITH_OPENSUBDIV)
find_package_wrapper(OpenSubdiv)
@@ -601,3 +594,10 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -static-intel")
endif()
+
+# Avoid conflicts with Mesa llvmpipe, Luxrender, and other plug-ins that may
+# use the same libraries as Blender with a different version or build options.
+set(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -fvisibility=hidden")
+set(PLATFORM_LINKFLAGS
+ "${PLATFORM_LINKFLAGS} -Wl,--version-script='${CMAKE_SOURCE_DIR}/source/creator/blender.map'"
+)