From 90a75ca55c0e03ba10378aed5c219007fdb859a3 Mon Sep 17 00:00:00 2001 From: superp00t Date: Sun, 8 Sep 2024 19:53:50 -0400 Subject: [PATCH] chore(build): link standard libraries statically in MinGW --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd8d940..a21e662 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,11 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GN endif () endif () +# MinGW Options +if (WHOA_SYSTEM_WIN AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} "-static-libgcc -static-libstdc++ -static") +endif () + # OS defines if (WHOA_SYSTEM_WIN) # Avoid win32 header hell