Skip to content

Commit a567f55

Browse files
authored
Merge pull request ceph#53800 from batrick/cmake-debug-wrn
CMakeLists: warn if CMAKE_BUILD_TYPE is set/unset Reviewed-by: Ilya Dryomov <[email protected]>
2 parents 28cb4d1 + b8c6ba0 commit a567f55

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ endforeach()
2424
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/")
2525

2626
if(NOT CMAKE_BUILD_TYPE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
27+
message(WARNING "CMAKE_BUILD_TYPE not specified, assuming CMAKE_BUILD_TYPE=Debug because .git exists.")
2728
set(default_build_type "Debug")
2829
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
2930
STRING "Default BUILD_TYPE is Debug, other options are: RelWithDebInfo, Release, and MinSizeRel." FORCE)
31+
else()
32+
message(WARNING "CMAKE_BUILD_TYPE not specified, leaving unset because .git does NOT exist.")
3033
endif()
3134

3235
if(CMAKE_SYSTEM_NAME MATCHES "Linux")

0 commit comments

Comments
 (0)