mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
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:
committed by
GitHub
parent
86d5ee5414
commit
92285f7c9d
@@ -113,6 +113,17 @@ else()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D__SSE__")
|
||||
endif()
|
||||
|
||||
# Set a module's COMPILE_FLAGS if using gcc or clang.
|
||||
macro(set_gnulike_module_compile_flags flags)
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?Clang")
|
||||
SET_SOURCE_FILES_PROPERTIES(
|
||||
${${MODULE_NAME}_SOURCES}
|
||||
PROPERTIES
|
||||
COMPILE_FLAGS ${flags}
|
||||
)
|
||||
endif()
|
||||
endmacro(set_gnulike_module_compile_flags)
|
||||
|
||||
if(MSVC)
|
||||
# Don't warn when using standard non-secure functions.
|
||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||
|
||||
Reference in New Issue
Block a user