From 825ca07561c057b6d951a16bea05c2ebc8ddd4bc Mon Sep 17 00:00:00 2001 From: Peter Keresztes Schmidt Date: Mon, 8 Feb 2021 22:54:40 +0100 Subject: [PATCH] Build: Use zm-* interfaces to set cxx standard and warning flags --- CMakeLists.txt | 15 ++++++--------- cmake/compiler/clang/settings.cmake | 3 +++ cmake/compiler/gcc/settings.cmake | 3 +++ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b5d27577..efc75e905 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,18 +31,15 @@ endif() #set(CMAKE_VERBOSE_MAKEFILE ON) #set(CMAKE_INSTALL_ALWAYS ON) -set(CMAKE_CXX_STANDARD 11) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") # Default CLFAGS and CXXFLAGS: -set(CMAKE_C_FLAGS_RELEASE "-Wall -O2") -set(CMAKE_CXX_FLAGS_RELEASE "-Wall -O2") -set(CMAKE_C_FLAGS_DEBUG "-Wall -g") -set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g") -set(CMAKE_C_FLAGS_OPTIMISED "-Wall -O3") -set(CMAKE_CXX_FLAGS_OPTIMISED "-Wall -O3") +set(CMAKE_C_FLAGS_RELEASE "-O2") +set(CMAKE_CXX_FLAGS_RELEASE "-O2") +set(CMAKE_C_FLAGS_DEBUG "-g") +set(CMAKE_CXX_FLAGS_DEBUG "-g") +set(CMAKE_C_FLAGS_OPTIMISED "-O3") +set(CMAKE_CXX_FLAGS_OPTIMISED "-O3") set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") -set(CMAKE_CXX_STANDARD 11) include(ConfigureBaseTargets) include(CheckPlatform) diff --git a/cmake/compiler/clang/settings.cmake b/cmake/compiler/clang/settings.cmake index e69de29bb..1d6a0e8f4 100644 --- a/cmake/compiler/clang/settings.cmake +++ b/cmake/compiler/clang/settings.cmake @@ -0,0 +1,3 @@ +target_compile_options(zm-warning-interface + INTERFACE + -Wall) diff --git a/cmake/compiler/gcc/settings.cmake b/cmake/compiler/gcc/settings.cmake index e69de29bb..1d6a0e8f4 100644 --- a/cmake/compiler/gcc/settings.cmake +++ b/cmake/compiler/gcc/settings.cmake @@ -0,0 +1,3 @@ +target_compile_options(zm-warning-interface + INTERFACE + -Wall)