Skip to content

Commit df8435f

Browse files
layusazarzadavila
authored andcommitted
static windows libstdc++
1 parent 4b46549 commit df8435f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ if(MINGW)
3838
CACHE STRING "Version of GCC in your MinGW installation")
3939

4040
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format -Wno-format-extra-args")
41-
set(CMAKE_CXX_STANDARD_LIBRARIES "-static -lwsock32 -lws2_32 ${CMAKE_CSS_STANDARD_LIBRARIES}")
42-
41+
# Linking mingw libs statically
42+
set(CMAKE_CXX_STANDARD_LIBRARIES "-Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive, -static-libgcc -static-libstdc++ -lwsock32 -lws2_32 ${CMAKE_CSS_STANDARD_LIBRARIES}")
43+
4344
# Check for gcc target architecture
4445
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE GCC_ARCH)
4546
string(STRIP "${GCC_ARCH}" GCC_ARCH_TRIPLE)

0 commit comments

Comments
 (0)