From 04db5a95657a8c1ad1db36570eadaeedbea01cbb Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Thu, 17 Apr 2025 02:34:39 -0700 Subject: Fix compiler warning with clang 18.1.8 on windows (#6843) * Fix compiler warning with clang 18.1.8 on windows --- cmake/CompilerFlags.cmake | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'cmake') 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} -- cgit v1.2.3