Skip to content

Commit

Permalink
Only print pre-release version if it makes sense to do so (#18958)
Browse files Browse the repository at this point in the history
The pre-release version was printed even if it was blank.  Move the message inside a pre-existing if condition so it'll only get printed if it's set.

Closes #18958

COPYBARA_INTEGRATE_REVIEW=#18958 from imrichardcole:task/remove-blank-printing f0dd1d9
PiperOrigin-RevId: 690727280
  • Loading branch information
imrichardcole authored and copybara-github committed Oct 28, 2024
1 parent e8e3253 commit 43570f2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,17 @@ string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\3"
string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\5"
protobuf_VERSION_PRERELEASE "${protobuf_VERSION_STRING}")

message(STATUS "${protobuf_VERSION_PRERELEASE}")

# Package version
set(protobuf_VERSION
"${protobuf_VERSION_MINOR}.${protobuf_VERSION_PATCH}")

if(protobuf_VERSION_PRERELEASE)
message(STATUS "${protobuf_VERSION_PRERELEASE}")
set(protobuf_VERSION "${protobuf_VERSION}.${protobuf_VERSION_PRERELEASE}")
else()
set(protobuf_VERSION "${protobuf_VERSION}.0")
endif()
message(STATUS "${protobuf_VERSION}")
message(STATUS "protobuf version: ${protobuf_VERSION}")

if(protobuf_VERBOSE)
message(STATUS "Configuration script parsing status [")
Expand Down

0 comments on commit 43570f2

Please sign in to comment.