CMake: Use static libstdc++ for static builds
This enables static linking of libstdc++ by default when building using `WITH_STATIC_LIBS`. This makes builds more portable for anyone making static builds (in particular for older systems). Reviewed By: brecht, campbellbarton, sergey Differential Revision: https://developer.blender.org/D4393
This commit is contained in:
@@ -39,6 +39,10 @@ if(EXISTS ${LIBDIR})
|
||||
set(WITH_OPENMP_STATIC ON)
|
||||
endif()
|
||||
|
||||
if(WITH_STATIC_LIBS)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++")
|
||||
endif()
|
||||
|
||||
# Wrapper to prefer static libraries
|
||||
macro(find_package_wrapper)
|
||||
if(WITH_STATIC_LIBS)
|
||||
|
Submodule release/datafiles/locale updated: 29c2218102...f81ed05215
Submodule release/scripts/addons updated: c94604993b...26330ab143
Submodule release/scripts/addons_contrib updated: 3a80a18ea0...57596569d9
Reference in New Issue
Block a user