Skip to content

Commit

Permalink
[FIX] compile: gcc version > 11.3, treat -Wmaybe-uninitialized as error
Browse files Browse the repository at this point in the history
  • Loading branch information
Simonhancrew authored and simonhan committed Dec 8, 2023
1 parent 9772a29 commit 7405ce2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ else()
add_compile_options(-fdiagnostics-color)
endif()

check_cxx_compiler_flag(-Wno-maybe-uninitialized flag_no_maybe_uninit)
if (flag_no_maybe_uninit)
add_compile_options(-Wno-maybe-uninitialized)
endif()

if(NOT NINJA_FORCE_PSELECT)
# Check whether ppoll() is usable on the target platform.
# Set -DUSE_PPOLL=1 if this is the case.
Expand Down Expand Up @@ -255,6 +260,8 @@ if(BUILD_TESTING)
endif()
endif()



# Tests all build into ninja_test executable.
add_executable(ninja_test
src/build_log_test.cc
Expand Down

0 comments on commit 7405ce2

Please sign in to comment.