Skip to content

Commit 5eae1ac

Browse files
committed
Move build type to top level
1 parent f4682f5 commit 5eae1ac

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ project(kcron C)
44

55
set(LANGUAGES "C")
66

7+
if(NOT CMAKE_BUILD_TYPE)
8+
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
9+
"Build type (Debug, Release, RelWithDebInfo, MinSizeRel)" FORCE
10+
)
11+
message(STATUS "Build type not specified, defaulting to RelWithDebInfo")
12+
endif()
13+
14+
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
15+
716
execute_process(COMMAND git describe --abbrev=0 OUTPUT_VARIABLE VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
817

918
####

src/C/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,6 @@ add_link_options(
199199
-Wl,--as-needed # Only link used symbols
200200
)
201201

202-
#############################
203-
# Build Type Configuration
204-
if(NOT CMAKE_BUILD_TYPE)
205-
set(CMAKE_BUILD_TYPE RELWITHDEBINFO)
206-
message(STATUS "Build type not specified, defaulting to RELWITHDEBINFO")
207-
endif(NOT CMAKE_BUILD_TYPE)
208-
209-
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
210-
211202
#############################
212203
# Compiler Hardening Flags
213204

0 commit comments

Comments
 (0)