cmake: Add set_gnulike_module_compile_flags (#1510)

Factor out a macro to set module-specific compilation flags for
GNU-like compilers.  This simplifies setting compilation flags per
test.

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>

Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
Sven van Haastregt
2022-09-22 21:17:55 +01:00
committed by GitHub
parent 86d5ee5414
commit 92285f7c9d
3 changed files with 15 additions and 16 deletions

View File

@@ -21,13 +21,7 @@ set(${MODULE_NAME}_SOURCES
# Make unused variables not fatal in this module; see
# https://github.com/KhronosGroup/OpenCL-CTS/issues/1484
if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?Clang")
SET_SOURCE_FILES_PROPERTIES(
${${MODULE_NAME}_SOURCES}
PROPERTIES
COMPILE_FLAGS "-Wno-error=unused-variable"
)
endif()
set_gnulike_module_compile_flags("-Wno-error=unused-variable")
include(../../CMakeCommon.txt)