Static linking only when PREFER_BUNDLED_LIBS (closes #1295)

This commit is contained in:
Dennis Felsing 2018-09-19 07:58:17 +02:00
parent 0605a4f662
commit c7941db9d4

View file

@ -1499,7 +1499,7 @@ foreach(target ${TARGETS_LINK})
target_link_libraries(${target} -stdlib=libc++)
target_link_libraries(${target} -mmacosx-version-min=10.7)
endif()
if(MINGW OR TARGET_OS STREQUAL "linux")
if((MINGW OR TARGET_OS STREQUAL "linux") AND PREFER_BUNDLED_LIBS)
# Statically link the standard libraries with on MinGW/Linux so we don't
# have to ship them as DLLs.
target_link_libraries(${target} -static-libgcc)