Skip to content

Commit b97579e

Browse files
committed
Try to fix static build 5
1 parent af85a6d commit b97579e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dynadjust/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ if (BUILD_STATIC)
6767
# Build internal libraries as static instead of shared
6868
set(DNA_LIBRARY_TYPE STATIC)
6969

70+
# For maximum portability, statically link libstdc++ and libgcc
71+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++ -static-libgcc")
72+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libstdc++ -static-libgcc")
73+
7074
# Include static build optimizations
7175
include(${CMAKE_CURRENT_LIST_DIR}/cmake/StaticBuildOptimizations.cmake)
7276

@@ -572,9 +576,6 @@ if(BUILD_STATIC)
572576
message("")
573577
message(STATUS "STATIC_LIBS_LIST=${STATIC_LIBS_LIST}")
574578

575-
# For maximum portability, statically link libstdc++ and libgcc
576-
add_link_options(-static-libstdc++ -static-libgcc)
577-
578579
# Find static versions of xerces-c dependencies (curl and ICU)
579580
find_library(CURL_STATIC_LIB NAMES libcurl.a HINTS
580581
ENV LIBRARY_PATH /g/data/ms9/.envbin/lib /usr/lib64 /usr/lib)

0 commit comments

Comments
 (0)