Skip to content

Commit

Permalink
Enable static cmake build for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
superctr committed Sep 15, 2022
1 parent 5ada04e commit 5866471
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ find_package(OpenGL REQUIRED)
pkg_check_modules(GLFW3 REQUIRED glfw3)
pkg_check_modules(CPPUNIT cppunit)

if(MINGW)
option(LINK_STATIC_LIBS "link with static runtime libraries (MinGW only)" ON)
if(LINK_STATIC_LIBS)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(CMAKE_CXX_STANDARD_LIBRARIES "-static-libgcc -static-libstdc++ -lwsock32 -lws2_32 ${CMAKE_CXX_STANDARD_LIBRARIES}")
#This gets already set by libvgm...
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive")
set(GLFW3_LIBRARIES -static ${GLFW3_STATIC_LIBRARIES} -dynamic)
endif()
else()
option(LINK_STATIC_LIBS "link with static runtime libraries (MinGW only)" OFF)
endif()

add_subdirectory(ctrmml)
add_subdirectory(libvgm)

Expand Down

0 comments on commit 5866471

Please sign in to comment.