Skip to content

Commit d8836e3

Browse files
committed
fix the static lib don't work on MinGW
1 parent 53bce5b commit d8836e3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mingw_cross_toolchain.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ SET(CMAKE_FIND_ROOT_PATH /usr/${GNU_HOST} /home/joey/workspace/testkit-lite/sha
1111
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
1212
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
1313
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
14+
15+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc")
16+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
17+
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -static-libgcc -s")
18+
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS} -static-libgcc -static-libstdc++ -s")

0 commit comments

Comments
 (0)