Skip to content

Commit

Permalink
linker flags for MinGW - must statically link with libc++ and libwinp…
Browse files Browse the repository at this point in the history
…thread
  • Loading branch information
lasagnaphil committed Apr 10, 2019
1 parent 853abc6 commit f38bfa1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ endif(CCACHE_FOUND)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
if(MINGW)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,-Bdynamic,--whole-archive")
endif(MINGW)

set(ALTLIB_DIR ${PROJECT_SOURCE_DIR}/deps/altlib)
add_subdirectory(${ALTLIB_DIR})
Expand Down

0 comments on commit f38bfa1

Please sign in to comment.