fixup! Put -Wno-redundant-move behind a compiler check

Use -Werror in the CMake test because the compiler check passes even
if warnings are emitted.
This commit is contained in:
Mahmoud Al-Qudsi 2020-07-05 13:31:21 -05:00
parent 1ca05d32d3
commit fb4967945a

View file

@ -13,7 +13,9 @@ if(APPLE)
endif()
endif()
check_cxx_compiler_flag("-Wno-redundant-move" HAS_NO_REDUNDANT_MOVE)
# An unrecognized flag is usually a warning and not an error, which CMake apparently does
# not pick up on. Combine it with -Werror to determine if it's actually supported.
check_cxx_compiler_flag("-Wno-redundant-move -Werror" HAS_NO_REDUNDANT_MOVE)
if (HAS_NO_REDUNDANT_MOVE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-redundant-move")
endif()