Fail on unset GIT_DESC/GIT_COMMIT

This commit is contained in:
Patrick Nicolas committed 2026-03-17 14:41:51 +01:00
1 parent 78addc1f22
commit caa191ff06
3 files changed
+8 -4

No files matched your search

+2
View File
@@ -141,6 +141,8 @@ jobs:
-DFETCHCONTENT_BASE_DIR=${{github.workspace}}/cmake-fetch
--preset dashboard
-DWIVRN_USE_SYSTEM_OPENXR=OFF
-DGIT_DESC=${{github.sha}}
-DGIT_COMMIT=${{github.sha}}
- name: Build
# Build your program with the given configuration
+2 -4
View File
@@ -20,15 +20,13 @@ if (NOT GIT_COMMIT)
endif()
if (NOT GIT_DESC)
set(GIT_DESC v${CMAKE_PROJECT_VERSION})
message(STATUS "Setting version to ${GIT_DESC} from CMakeLists")
message(FATAL_ERROR "GIT_DESC cannot be inferred from .git and was not provided at build time")
endif()
if (GIT_COMMIT)
message(STATUS "Setting commit to ${GIT_COMMIT}")
else()
set(GIT_COMMIT "")
message(STATUS "Not setting commit")
message(FATAL_ERROR "GIT_COMMIT cannot be inferred from .git and was not provided at build time")
endif()
configure_file(${INPUT_FILE} ${OUTPUT_FILE})
+4
View File
@@ -64,6 +64,10 @@
buildInputs = oldAttrs.buildInputs ++ extraBuildInputs;
nativeBuildInputs = oldAttrs.nativeBuildInputs ++ extraNativeBuildInputs;
cmakeFlags = (oldAttrs.cmakeFlags or []) ++ [
(lib.cmakeFeature "GIT_DESC" "nightly")
(lib.cmakeFeature "GIT_COMMIT" "nightly")
];
}));
in {
packages = {