Skip to content

Commit

Permalink
update CMAKE_BUILD_TYPE setter
Browse files Browse the repository at this point in the history
  • Loading branch information
Jettford committed Dec 11, 2024
1 parent badde23 commit 8e8d015
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) # Set C and C++ symbol visibility to hid
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug, Release, RelWithDebInfo, MinSizeRel")

if (${CMAKE_BUILD_TYPE} MATCHES "") # CI likes to set CMAKE_BUILD_TYPE to an empty string
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()

set(DLU_CONFIG_DIR ${CMAKE_SOURCE_DIR}/build CACHE PATH "The directory where the server configuration files are stored")

# Read variables from file
Expand Down

3 comments on commit 8e8d015

@jadebenn
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I figured out how to handle this properly. If a 'default' build type is set prior to the project() command, I think it'll be overwritten by user specification but will otherwise be kept. I might make a commit showing what I mean.

@Jettford
Copy link
Collaborator Author

@Jettford Jettford commented on 8e8d015 Dec 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You misunderstand what this is doing, this only ever does something if the value is set but set as an empty string, not if it isn't set.

@jadebenn
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay. Yeah, I misunderstood your intent here.

Please sign in to comment.