diff options
author | Jan Niklas Hasse <jhasse@bixense.com> | 2024-02-13 13:04:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-13 13:04:25 (GMT) |
commit | 7ea6df3ae918309e94fa730ae76b01a7c04505d1 (patch) | |
tree | 1792db194e02bc0d8bd920dcc5e54cabea068127 | |
parent | fd7067652cae480190bf13b2ee5475efdf09ac7d (diff) | |
parent | 8b42a300bd57b93a8037e5097041c639ade8f9db (diff) | |
download | Ninja-7ea6df3ae918309e94fa730ae76b01a7c04505d1.zip Ninja-7ea6df3ae918309e94fa730ae76b01a7c04505d1.tar.gz Ninja-7ea6df3ae918309e94fa730ae76b01a7c04505d1.tar.bz2 |
Merge pull request #2375 from scivision/correct-flag
correction to #2360
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a5ef00..90e3418 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -255,9 +255,9 @@ if(BUILD_TESTING) # NOTE: gtest uninit some variables, gcc >= 1.11.3 may cause error on compile. # Remove this comment and six lines below, once ninja deps gtest-1.11.0 or above. - if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "1.11.3") - check_cxx_compiler_flag(-Wno-maybe-uninitialized flag_no_maybe_uninit) - if (flag_no_maybe_uninit) + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "1.11.3") + check_cxx_compiler_flag(-Wmaybe-uninitialized flag_maybe_uninit) + if (flag_maybe_uninit) target_compile_options(gtest PRIVATE -Wno-maybe-uninitialized) endif() endif() |