Skip to content

Commit cd676e5

Browse files
committed
[lldb] Guard some GCC-style flags from MSVC
A follow up to #92953. Suggested in #92953 (comment)
1 parent 16397e8 commit cd676e5

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lldb/cmake/modules/LLDBConfig.cmake

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,15 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/../clang/include")
186186
# printed. Therefore, check for whether the compiler supports options in the
187187
# form -W<foo>, and if supported, add the corresponding -Wno-<foo> option.
188188

189-
# Disable GCC warnings
190-
append("-Wno-deprecated-declarations" CMAKE_CXX_FLAGS)
191-
append("-Wno-unknown-pragmas" CMAKE_CXX_FLAGS)
192-
append("-Wno-strict-aliasing" CMAKE_CXX_FLAGS)
193-
194-
check_cxx_compiler_flag("-Wstringop-truncation" CXX_SUPPORTS_STRINGOP_TRUNCATION)
195-
append_if(CXX_SUPPORTS_STRINGOP_TRUNCATION "-Wno-stringop-truncation" CMAKE_CXX_FLAGS)
189+
if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
190+
# Disable GCC warnings
191+
append("-Wno-deprecated-declarations" CMAKE_CXX_FLAGS)
192+
append("-Wno-unknown-pragmas" CMAKE_CXX_FLAGS)
193+
append("-Wno-strict-aliasing" CMAKE_CXX_FLAGS)
194+
195+
check_cxx_compiler_flag("-Wstringop-truncation" CXX_SUPPORTS_STRINGOP_TRUNCATION)
196+
append_if(CXX_SUPPORTS_STRINGOP_TRUNCATION "-Wno-stringop-truncation" CMAKE_CXX_FLAGS)
197+
endif()
196198

197199
# Disable Clang warnings
198200
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")

0 commit comments

Comments
 (0)