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
path: root/extern
diff options
context:
space:
mode:
authorSebastián Barschkis <sebbas@sebbas.org>2020-09-25 11:17:10 +0300
committerSebastián Barschkis <sebbas@sebbas.org>2020-10-12 13:45:11 +0300
commitab65fe5a2dcca9cb5de14eaeabe5a441bc41f15a (patch)
tree4f5575ada7e3f07f1dbe35556978fcdee90167ab /extern
parente8d02359cf0853d32722ead7513bd6d28318c92d (diff)
Fluid: Use hidden symbol visibility
This resolves a long list of linker warnings that is currently only showing up on macOS arm builds. The warnings themselves are of this shape (one example): ``` ld: warning: direct access in function 'Manta::MeshDataImpl<Manta::Vector3D<float> >::_W_39(_object, object, object*)' from file '../../lib/libextern_mantaflow.a(mesh.h.reg.cpp.o)' to global weak symbol 'typeinfo for Manta::MeshDataImpl<Manta::Vector3D<float> >' from file '../../lib/libextern_mantaflow.a(mesh.cpp.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings. ``` Just would like to get your opinion to make sure this is an acceptable way to handle this on all platforms. Reviewed By: LazyDodo Differential Revision: https://developer.blender.org/D9002
Diffstat (limited to 'extern')
-rw-r--r--extern/mantaflow/CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/extern/mantaflow/CMakeLists.txt b/extern/mantaflow/CMakeLists.txt
index 8bb0bc69f98..fe6c72660e0 100644
--- a/extern/mantaflow/CMakeLists.txt
+++ b/extern/mantaflow/CMakeLists.txt
@@ -31,6 +31,17 @@ if(MSVC_CLANG AND WITH_OPENMP AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0.1
remove_cc_flag("-fopenmp")
endif()
+# Exporting functions from the blender binary gives linker warnings on Apple arm64 systems.
+# For now and until Apple arm64 is officially supported, these will just be silenced here.
+# TODO (sebbas): Check if official arm64 devices give linker warnings without this block.
+
+if(APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))
+ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
+ endif()
+endif()
+
set(MANTAVERSION "0.13")
add_definitions(-DWITH_FLUID=1)