diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2025-04-17 02:34:39 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-17 09:34:39 +0000 |
| commit | 04db5a95657a8c1ad1db36570eadaeedbea01cbb (patch) | |
| tree | 4d61bd130c86a0d60c55bf1fa14e79b6fce8dcd7 /cmake/CompilerFlags.cmake | |
| parent | 297417c754961d2c1c3f8a2e94126c668e4574bc (diff) | |
Fix compiler warning with clang 18.1.8 on windows (#6843)
* Fix compiler warning with clang 18.1.8 on windows
Diffstat (limited to 'cmake/CompilerFlags.cmake')
| -rw-r--r-- | cmake/CompilerFlags.cmake | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/cmake/CompilerFlags.cmake b/cmake/CompilerFlags.cmake index ad9a69185..32d43d360 100644 --- a/cmake/CompilerFlags.cmake +++ b/cmake/CompilerFlags.cmake @@ -152,14 +152,17 @@ function(set_default_compile_options target) add_supported_cxx_flags(${target} PRIVATE ${warning_flags}) - add_supported_cxx_linker_flags( - ${target} - PRIVATE - # Don't assume that symbols will be resolved at runtime - "-Wl,--no-undefined" - # No reason not to do this? Useful when using split debug info - "-Wl,--build-id" - ) + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + # valid linker options only for GNU/Clang + add_supported_cxx_linker_flags( + ${target} + PRIVATE + # Don't assume that symbols will be resolved at runtime + "-Wl,--no-undefined" + # No reason not to do this? Useful when using split debug info + "-Wl,--build-id" + ) + endif() set_target_properties( ${target} |
