Skip to content

Commit b40a760

Browse files
committed
Replace CompilerFlags with CompilerSettings
The new module takes a completely different approach that is more straightforward and easier to understand. Signed-off-by: Derek G Foster <[email protected]>
1 parent 3624d12 commit b40a760

File tree

3 files changed

+105
-275
lines changed

3 files changed

+105
-275
lines changed

CMakeLists.txt

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,12 @@ cmake_minimum_required(VERSION 3.15)
1010
# Set before the first project() command.
1111
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Type of build to perform")
1212

13-
# Include before the project() command.
14-
set(ENABLE_PIE_FLAG OFF)
15-
set(ENABLE_SANITIZE_CFI OFF)
16-
set(ENABLE_SPECTRE_FLAGS OFF)
17-
include(cmake/CompilerFlags.cmake)
18-
define_compiler_init_variables()
19-
2013
project(networking-recipe VERSION 23.07 LANGUAGES C CXX)
2114

2215
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
2316

2417
include(CMakePrintHelpers)
18+
include(CompilerSettings)
2519
include(CTest)
2620
include(FindPkgConfig)
2721
include(GNUInstallDirs)
@@ -66,7 +60,6 @@ include(SelectTdiTarget)
6660
###################
6761

6862
option(SET_RPATH "Set RPATH in libraries and executables" OFF)
69-
7063
option(WITH_KRNLMON "Enable Kernel Monitor support" ON)
7164
option(WITH_OVSP4RT "Enable OVS support" ON)
7265

@@ -78,9 +71,12 @@ endif()
7871
cmake_print_variables(WITH_KRNLMON)
7972
cmake_print_variables(WITH_OVSP4RT)
8073

81-
###########################
82-
# Global compiler options #
83-
###########################
74+
############################
75+
# Global compiler settings #
76+
############################
77+
78+
add_basic_settings()
79+
add_security_settings(${CMAKE_BUILD_TYPE})
8480

8581
add_compile_options(-D${TARGETFLAG})
8682

@@ -92,8 +88,6 @@ if(NOT DEPEND_INSTALL_DIR STREQUAL "")
9288
endif()
9389
endif()
9490

95-
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
96-
9791
############################
9892
# find_xxxx() search paths #
9993
############################

cmake/CompilerFlags.cmake

Lines changed: 0 additions & 262 deletions
This file was deleted.

0 commit comments

Comments
 (0)