From e90b07c350825c12e1781a228c2bdc86fedc9cb3 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Fri, 16 Jun 2023 23:21:46 +0200 Subject: [PATCH] Set minimal linker flags for static windows build --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c95b80..0482d48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -240,6 +240,13 @@ if ("${STATIC_BUILD}") ) set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${CMAKE_INSTALL_PREFIX}/lib/pulseaudio") endif () + + if (BUILD_WINDOWS) + # Missing SDL2 static dependencies + list (APPEND planetblupi_DEPS + -lwinmm -limm32 -lsetupapi -lversion + ) + endif () else () set (planetblupi_DEPS ${SDL2_LIBRARIES} @@ -258,7 +265,7 @@ else () endif () endif () -target_link_libraries (${planetblupi_OUTPUT} PUBLIC ${planetblupi_DEPS} -Wl,--dynamicbase -Wl,--nxcompat -Wl,--high-entropy-va -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid) +target_link_libraries (${planetblupi_OUTPUT} PUBLIC ${planetblupi_DEPS}) ########## ## GetText