Fix link flags for Clang-based MinGW cross compile (#5342)

See https://github.com/android/ndk/issues/1464

The old code tested for Windows and GCC as the compiler.
Instead of checking for GCC, check the compiler is not MSVC.
This commit is contained in:
David Neto 2023-07-20 10:09:23 -04:00 committed by GitHub
parent 2813da2681
commit c50bc49f58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -243,7 +243,7 @@ function(spvtools_default_compile_options TARGET)
# For MinGW cross compile, statically link to the C++ runtime.
# But it still depends on MSVCRT.dll.
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
if (NOT MSVC)
set_target_properties(${TARGET} PROPERTIES
LINK_FLAGS -static -static-libgcc -static-libstdc++)
endif()