From e60c1f84a7e13577a82046b02b214f9466d20a7c Mon Sep 17 00:00:00 2001 From: Naios Date: Tue, 31 Oct 2017 01:29:51 +0100 Subject: Build: Use interface targets for inheriting flags and definitions * Remove the usage of global flags and definitions set through the CMAKE_CXX_FLAGS variable. * Use cmake target compile features for setting the CXX standard automatically. * Make C++14 globally available in the project * Closes #21033 --- cmake/compiler/icc/settings.cmake | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'cmake/compiler/icc') diff --git a/cmake/compiler/icc/settings.cmake b/cmake/compiler/icc/settings.cmake index 133bc15e59e..563b92d6b9b 100644 --- a/cmake/compiler/icc/settings.cmake +++ b/cmake/compiler/icc/settings.cmake @@ -1,18 +1,28 @@ -# Set build-directive (used in core to tell which buildtype we used) -add_definitions(-D_BUILD_DIRECTIVE="'${CMAKE_BUILD_TYPE}'") +target_compile_definitions(trinity-compile-option-interface + INTERFACE + -D_BUILD_DIRECTIVE="${CMAKE_BUILD_TYPE}") if(PLATFORM EQUAL 32) - add_definitions(-axSSE2) + target_compile_options(trinity-compile-option-interface + INTERFACE + -axSSE2) else() - add_definitions(-xSSE2) + target_compile_options(trinity-compile-option-interface + INTERFACE + -xSSE2) endif() if( WITH_WARNINGS ) - add_definitions(-w1) + target_compile_options(trinity-warning-interface + INTERFACE + -w1) + message(STATUS "ICC: All warnings enabled") endif() if( WITH_COREDEBUG ) - add_definitions(-g) + target_compile_options(trinity-compile-option-interface + INTERFACE + -g) message(STATUS "ICC: Debug-flag set (-g)") endif() -- cgit v1.2.3