Skip to content

Commit 5b7c35d

Browse files
authored
Merge pull request ceph#63182 from Matan-B/wip-matanb-crimson-tentacle-cmake-rel
tentacle: CMakeLists: Fallback to RelWithDebInfo Reviewed-by: Samuel Just <[email protected]> Reviewed-by: Patrick Donnelly <[email protected]>
2 parents 5a47559 + 4549e8e commit 5b7c35d

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@ if(NOT CMAKE_BUILD_TYPE)
1616
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
1717
message(WARNING "CMAKE_BUILD_TYPE not specified, assuming CMAKE_BUILD_TYPE=Debug because .git exists.")
1818
set(default_build_type "Debug")
19-
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
20-
STRING "Default BUILD_TYPE is Debug, other options are: RelWithDebInfo, Release, and MinSizeRel." FORCE)
2119
else()
22-
message(WARNING "CMAKE_BUILD_TYPE not specified, leaving unset because .git does NOT exist.")
20+
message(WARNING "CMAKE_BUILD_TYPE not specified, setting to RelWithDebInfo because .git does NOT exist.")
21+
set(default_build_type "RelWithDebInfo")
2322
endif()
23+
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
24+
STRING "BUILD_TYPE is ${default_build_type}, other options are: RelWithDebInfo, Release, and MinSizeRel." FORCE)
2425
endif()
26+
message(STATUS "BUILD_TYPE is ${CMAKE_BUILD_TYPE}")
27+
set(CEPH_BUILD_TYPE ${CMAKE_BUILD_TYPE})
2528

2629
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
2730
set(LINUX ON)

do_cmake.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,20 @@ EOF
105105
echo done.
106106

107107
if [[ ! "$ARGS $@" =~ "-DCMAKE_BUILD_TYPE" ]]; then
108-
cat <<EOF
109-
108+
if [ -d ../.git ]; then
109+
printf "
110110
****
111-
WARNING: do_cmake.sh now creates debug builds by default. Performance
112-
may be severely affected. Please use -DCMAKE_BUILD_TYPE=RelWithDebInfo
111+
WARNING: do_cmake.sh now creates debug builds by default if .git exists.
112+
Performance may be severely affected. Please use -DCMAKE_BUILD_TYPE=RelWithDebInfo
113113
if a performance sensitive build is required.
114114
****
115-
EOF
115+
"
116+
else
117+
printf "
118+
****
119+
WARNING: do_cmake.sh now creates RelWithDebInfo builds by default when .git is absent.
120+
****
121+
"
122+
fi
116123
fi
117124

src/ceph_release.h.in.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
#define CEPH_RELEASE @CEPH_RELEASE@
55
#define CEPH_RELEASE_NAME "@CEPH_RELEASE_NAME@"
66
#define CEPH_RELEASE_TYPE "@CEPH_RELEASE_TYPE@"
7+
#define CEPH_BUILD_TYPE "@CEPH_BUILD_TYPE@"
78

89
#endif

src/common/version.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ std::string const pretty_version_to_str(void)
4949
oss << "ceph version " << CEPH_GIT_NICE_VER
5050
<< " (" << STRINGIFY(CEPH_GIT_VER) << ") "
5151
<< ceph_release_name(CEPH_RELEASE)
52-
<< " (" << CEPH_RELEASE_TYPE << ")"
52+
<< " (" << CEPH_RELEASE_TYPE << " - "
53+
<< CEPH_BUILD_TYPE << ")"
5354
#ifdef WITH_CRIMSON
5455
<< " (crimson)"
5556
#endif

0 commit comments

Comments
 (0)