[NFC] cmake: do not suppress -Wsign-compare globally (#1810)

Only disable `-Wsign-compare` for tests that do not compile cleanly
with this warning enabled.  Re-enable the warning for the other tests,
so that it can catch any new occurrences.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2023-09-20 15:48:25 +01:00
committed by GitHub
parent 1c616238bc
commit aa953aaa51
11 changed files with 17 additions and 8 deletions

View File

@@ -103,9 +103,6 @@ if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?Clang"
if(NOT CMAKE_BUILD_TYPE MATCHES "Release|RelWithDebInfo|MinSizeRel") if(NOT CMAKE_BUILD_TYPE MATCHES "Release|RelWithDebInfo|MinSizeRel")
# Enable more warnings if not doing a release build. # Enable more warnings if not doing a release build.
add_cxx_flag_if_supported(-Wall) add_cxx_flag_if_supported(-Wall)
# Suppress warnings that currently trigger on the code base.
# This list should shrink over time when warnings are fixed.
add_cxx_flag_if_supported(-Wno-sign-compare)
endif() endif()
add_cxx_flag_if_supported(-Wno-narrowing) add_cxx_flag_if_supported(-Wno-narrowing)
add_cxx_flag_if_supported(-Wno-format) add_cxx_flag_if_supported(-Wno-format)

View File

@@ -17,6 +17,6 @@ set(${MODULE_NAME}_SOURCES
test_migrate.cpp test_migrate.cpp
) )
set_gnulike_module_compile_flags("-Wno-sometimes-uninitialized") set_gnulike_module_compile_flags("-Wno-sometimes-uninitialized -Wno-sign-compare")
include(../CMakeCommon.txt) include(../CMakeCommon.txt)

View File

@@ -8,4 +8,6 @@ set(${MODULE_NAME}_SOURCES
allocation_utils.cpp allocation_utils.cpp
) )
set_gnulike_module_compile_flags("-Wno-sign-compare")
include(../CMakeCommon.txt) include(../CMakeCommon.txt)

View File

@@ -68,4 +68,6 @@ if(APPLE)
list(APPEND ${MODULE_NAME}_SOURCES test_queue_priority.cpp) list(APPEND ${MODULE_NAME}_SOURCES test_queue_priority.cpp)
endif(APPLE) endif(APPLE)
set_gnulike_module_compile_flags("-Wno-sign-compare")
include(../CMakeCommon.txt) include(../CMakeCommon.txt)

View File

@@ -7,4 +7,6 @@ set(${MODULE_NAME}_SOURCES
test_atomics.cpp test_atomics.cpp
) )
set_gnulike_module_compile_flags("-Wno-sign-compare")
include(../CMakeCommon.txt) include(../CMakeCommon.txt)

View File

@@ -16,6 +16,6 @@ set_source_files_properties(
COMPILE_FLAGS -march=i686) COMPILE_FLAGS -march=i686)
endif(NOT CMAKE_CL_64 AND NOT MSVC AND NOT ANDROID) endif(NOT CMAKE_CL_64 AND NOT MSVC AND NOT ANDROID)
set_gnulike_module_compile_flags("-Wno-unused-but-set-variable") set_gnulike_module_compile_flags("-Wno-unused-but-set-variable -Wno-sign-compare")
include(../CMakeCommon.txt) include(../CMakeCommon.txt)

View File

@@ -17,6 +17,6 @@ set(DEVICE_EXECUTION_SOURCES
utils.cpp utils.cpp
) )
include(../CMakeCommon.txt) set_gnulike_module_compile_flags("-Wno-sign-compare")
# end of file # include(../CMakeCommon.txt)

View File

@@ -17,6 +17,8 @@ set(${MODULE_NAME}_SOURCES
command_buffer_finalize.cpp command_buffer_finalize.cpp
) )
set_gnulike_module_compile_flags("-Wno-sign-compare")
include(../../CMakeCommon.txt) include(../../CMakeCommon.txt)
add_subdirectory( cl_khr_command_buffer_mutable_dispatch ) add_subdirectory( cl_khr_command_buffer_mutable_dispatch )

View File

@@ -12,4 +12,6 @@ set(${MODULE_NAME}_SOURCES
../basic_command_buffer.cpp ../basic_command_buffer.cpp
) )
set_gnulike_module_compile_flags("-Wno-sign-compare")
include(../../../CMakeCommon.txt) include(../../../CMakeCommon.txt)

View File

@@ -6,5 +6,7 @@ set(${MODULE_NAME}_SOURCES
test_geometrics.cpp test_geometrics.cpp
) )
set_gnulike_module_compile_flags("-Wno-sign-compare")
include(../CMakeCommon.txt) include(../CMakeCommon.txt)

View File

@@ -21,7 +21,7 @@ set(${MODULE_NAME}_SOURCES
# Make unused variables not fatal in this module; see # Make unused variables not fatal in this module; see
# https://github.com/KhronosGroup/OpenCL-CTS/issues/1484 # https://github.com/KhronosGroup/OpenCL-CTS/issues/1484
set_gnulike_module_compile_flags("-Wno-error=unused-variable -Wno-unused-but-set-variable") set_gnulike_module_compile_flags("-Wno-error=unused-variable -Wno-unused-but-set-variable -Wno-sign-compare")
include(../../CMakeCommon.txt) include(../../CMakeCommon.txt)