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
This commit is contained in:
11
extern/mantaflow/CMakeLists.txt
vendored
11
extern/mantaflow/CMakeLists.txt
vendored
@@ -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)
|
||||
|
Reference in New Issue
Block a user