mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-27 15:17:50 +00:00
build: always populate partial version variables
When FALCO_VERSION was provided via a CMake variable, the build would eventually fail because the partial version variables hadn't been populated. Move the creation of those outside the check of FALCO_VERSION being set so they also happen when that is provided too. Contributes-to: #1654 Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
This commit is contained in:
parent
2312afe9cd
commit
d4aa7b9747
@ -31,9 +31,12 @@ if(NOT FALCO_VERSION)
|
|||||||
else()
|
else()
|
||||||
# A tag has been found: use it as the Falco version
|
# A tag has been found: use it as the Falco version
|
||||||
set(FALCO_VERSION "${FALCO_TAG}")
|
set(FALCO_VERSION "${FALCO_TAG}")
|
||||||
# Remove the starting "v" in case there is one
|
|
||||||
string(REGEX REPLACE "^v(.*)" "\\1" FALCO_VERSION "${FALCO_TAG}")
|
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Remove the starting "v" in case there is one
|
||||||
|
string(REGEX REPLACE "^v(.*)" "\\1" FALCO_VERSION "${FALCO_VERSION}")
|
||||||
|
|
||||||
# TODO(leodido) > ensure Falco version is semver before extracting parts Populate partial version variables
|
# TODO(leodido) > ensure Falco version is semver before extracting parts Populate partial version variables
|
||||||
string(REGEX MATCH "^(0|[1-9][0-9]*)" FALCO_VERSION_MAJOR "${FALCO_VERSION}")
|
string(REGEX MATCH "^(0|[1-9][0-9]*)" FALCO_VERSION_MAJOR "${FALCO_VERSION}")
|
||||||
string(REGEX REPLACE "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\..*" "\\2" FALCO_VERSION_MINOR "${FALCO_VERSION}")
|
string(REGEX REPLACE "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\..*" "\\2" FALCO_VERSION_MINOR "${FALCO_VERSION}")
|
||||||
@ -46,6 +49,7 @@ if(NOT FALCO_VERSION)
|
|||||||
"\\5"
|
"\\5"
|
||||||
FALCO_VERSION_PRERELEASE
|
FALCO_VERSION_PRERELEASE
|
||||||
"${FALCO_VERSION}")
|
"${FALCO_VERSION}")
|
||||||
|
|
||||||
if(FALCO_VERSION_PRERELEASE STREQUAL "${FALCO_VERSION}")
|
if(FALCO_VERSION_PRERELEASE STREQUAL "${FALCO_VERSION}")
|
||||||
set(FALCO_VERSION_PRERELEASE "")
|
set(FALCO_VERSION_PRERELEASE "")
|
||||||
endif()
|
endif()
|
||||||
@ -55,5 +59,5 @@ if(NOT FALCO_VERSION)
|
|||||||
if(FALCO_VERSION_BUILD STREQUAL "${FALCO_VERSION}")
|
if(FALCO_VERSION_BUILD STREQUAL "${FALCO_VERSION}")
|
||||||
set(FALCO_VERSION_BUILD "")
|
set(FALCO_VERSION_BUILD "")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
message(STATUS "Falco version: ${FALCO_VERSION}")
|
message(STATUS "Falco version: ${FALCO_VERSION}")
|
||||||
|
Loading…
Reference in New Issue
Block a user