Skip to content

Commit 3efa6c2

Browse files
committed
try to fix mingw runtime issues.
1 parent e67196f commit 3efa6c2

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

test/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@ set_target_properties(
6161
)
6262
# gersemi: on
6363

64-
# CMAKE_SYSTEM_NAME refers to the target system
64+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows" AND MINGW)
65+
# Make the GDExtension DLL self-contained (no external MinGW runtime DLLs)
66+
target_link_options(${TARGET_NAME} PRIVATE "$<IF:$<BOOL:${MINGW}>,-static-libgcc;-static-libstdc++,>")
67+
68+
# Also ensure no undefined symbols
69+
target_link_options(${TARGET_NAME} PRIVATE -Wl,--no-undefined)
70+
endif()
71+
6572
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
6673
set_target_properties(
6774
${TARGET_NAME}

0 commit comments

Comments
 (0)