For MinGW, statically link exes against basic runtimes
Avoids the need to ship basic runtimes like libgcc_s_sjlj-1.dll with the executables.
This commit is contained in:
@@ -24,6 +24,17 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
|
||||
add_definitions(-std=c++11)
|
||||
endif()
|
||||
|
||||
function(glslang_set_link_args TARGET)
|
||||
# For MinGW compiles, statically link against the GCC and C++ runtimes.
|
||||
# This avoids the need to ship those runtimes as DLLs.
|
||||
if(WIN32)
|
||||
if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
|
||||
set_target_properties(${TARGET} PROPERTIES
|
||||
LINK_FLAGS "-static -static-libgcc -static-libstdc++")
|
||||
endif()
|
||||
endif(WIN32)
|
||||
endfunction(glslang_set_link_args)
|
||||
|
||||
# We depend on these for later projects, so they should come first.
|
||||
add_subdirectory(External)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user