You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] the CMake toolchain file's linker flags don't play well with other languages #2264
FYI, the LINKER: syntax in *_LINKER_FLAGS is only supported with CMP0181 (introduced in CMake 4.0). However, CMP0181 can only be queried from toolchain files and try_compile() test projects starting with CMake 4.5+.
I would suggest fixing this by checking if CMAKE_VERSION is at least 4.5, then querying CMP0181 status and reverting to -Xlinker syntax otherwise, rather than -Wl, syntax since it is more portable for languages like Swift.
As an aside, the NDK still sets -Qunused-arguments, which is a clang linker driver flag, not a linker flag. I would suggest either removing it if it is no longer required, or adding it to _ANDROID_NDK_INIT_CFLAGS instead.
I filed this bug with CMake a while ago with more details for features missing from CMake or the NDK for Swift support on Android.
Activity
Steelskin commentedon Nov 5, 2026
FYI, the
LINKER:syntax in*_LINKER_FLAGSis only supported withCMP0181(introduced in CMake 4.0). However,CMP0181can only be queried from toolchain files andtry_compile()test projects starting with CMake 4.5+.I would suggest fixing this by checking if
CMAKE_VERSIONis at least 4.5, then queryingCMP0181status and reverting to-Xlinkersyntax otherwise, rather than-Wl,syntax since it is more portable for languages like Swift.As an aside, the NDK still sets
-Qunused-arguments, which is a clang linker driver flag, not a linker flag. I would suggest either removing it if it is no longer required, or adding it to_ANDROID_NDK_INIT_CFLAGSinstead.I filed this bug with CMake a while ago with more details for features missing from CMake or the NDK for Swift support on Android.