Skip to content

Commit 8a46d0b

Browse files
committed
Support MinGW in Windows
1 parent f1ba08c commit 8a46d0b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: src/app/cmake/packaging/Windows.cmake

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Use main entry for Windows GUI app.
2-
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /subsystem:windows /entry:mainCRTStartup")
2+
if (MINGW)
3+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-subsystem,windows")
4+
# Static link MinGW standard libraries
5+
set(CMAKE_CXX_STANDARD_LIBRARIES
6+
"-static-libgcc -static-libstdc++ -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive")
7+
else ()
8+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /subsystem:windows /entry:mainCRTStartup")
9+
endif ()
310

411
# Copy .dll files on Windows to the target App build folder.
512
# For development:

0 commit comments

Comments
 (0)