Fix MinGW stack flag syntax and Python binding crashes

- Detect linker type (lld-link vs ld) and use the appropriate stack flag: /STACK:16777216 for lld-link, --stack,16777216 for MinGW ld

- Filter out stack-related flags from Python binding modules to prevent crashes when loading MuJoCo as a DLL in Python

Fixes #3011
This commit is contained in:
ashutosh0x
2026-02-11 22:31:29 +05:30
committed by Ashutosh0x
parent 6af0d4c823
commit 50349dc685
4 changed files with 17 additions and 27 deletions
+2
View File
@@ -51,6 +51,8 @@ endif()
include(MujocoLinkOptions)
get_mujoco_extra_link_options(EXTRA_LINK_OPTIONS)
list(FILTER EXTRA_LINK_OPTIONS EXCLUDE REGEX "STACK")
list(FILTER EXTRA_LINK_OPTIONS EXCLUDE REGEX "stack")
add_link_options(${EXTRA_LINK_OPTIONS})
include(MujocoMacOS)