CMake: Use static libstdc++ for static builds
authorLuca Rood <dev@lucarood.com>
Sat, 2 Mar 2019 01:53:09 +0000 (02:53 +0100)
committerLuca Rood <dev@lucarood.com>
Sat, 2 Mar 2019 01:53:09 +0000 (02:53 +0100)
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

build_files/cmake/platform/platform_unix.cmake
release/datafiles/locale
release/scripts/addons
release/scripts/addons_contrib

index 2bfc4cd..0d486c8 100644 (file)
@@ -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)
index 29c2218..f81ed05 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 29c2218102135522d6e2cd4bba7ab47d7241ab8a
+Subproject commit f81ed052157aff3979763cf25840032d11d261b6
index c946049..26330ab 160000 (submodule)
@@ -1 +1 @@
-Subproject commit c94604993b3e0bfbc733861e890aff18513e02b4
+Subproject commit 26330ab14347cef00d67e2e4335c9609082e227b
index 3a80a18..5759656 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 3a80a18ea081ff93f4b3672120b446b7adc93e81
+Subproject commit 57596569d9bc50230a0430e7ed159c963c00814c