Skip to content

Commit b5db1d1

Browse files
author
Steven Noonan
committed
cmake: set RelWithDebInfo as default build type
Signed-off-by: Steven Noonan <[email protected]>
1 parent 91d86ec commit b5db1d1

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ project(GameNetworkingSockets C CXX)
88

99
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
1010

11+
include(DefaultBuildType)
1112
find_package(Sanitizers)
1213

1314
if(SANITIZE_ADDRESS OR SANITIZE_THREAD OR SANITIZE_MEMORY OR SANITIZE_UNDEFINED)

cmake/DefaultBuildType.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Set a default build type if none was specified
2+
set(default_build_type "RelWithDebInfo")
3+
4+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
5+
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
6+
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
7+
8+
# Set the possible values of build type for cmake-gui
9+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
10+
endif()

0 commit comments

Comments
 (0)