aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-22 10:27:27 +0000
committer_ov4 <ov4@ov4.org>2026-10-22 10:27:27 +0000
commit273555f53458eb80d15c3d5c1910e57428818ee4 (patch)
tree4e50b42c9422232136e450ff8517ce9a47eb77f8 /cmake
parent0f3e8629c32b849291416411867141ded7bcaee0 (diff)
build(release): version compiler packages by their last source commit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/CompilerPaths.txt11
-rw-r--r--cmake/Release.cmake9
2 files changed, 17 insertions, 3 deletions
diff --git a/cmake/CompilerPaths.txt b/cmake/CompilerPaths.txt
new file mode 100644
index 0000000..9de9772
--- /dev/null
+++ b/cmake/CompilerPaths.txt
@@ -0,0 +1,11 @@
+cmake
+doc
+include
+lib
+pseudocode-lib
+tests
+tools
+CMakeLists.txt
+install.sh
+install.ps1
+LICENSE
diff --git a/cmake/Release.cmake b/cmake/Release.cmake
index 7ff1d2c..c825f74 100644
--- a/cmake/Release.cmake
+++ b/cmake/Release.cmake
@@ -1,16 +1,19 @@
-# Read HEAD at packaging time so subsequent commits do not require reconfiguration.
+# Read the last compiler commit at packaging time so subsequent commits do not require reconfiguration.
include("${CPSC_SOURCE_DIR}/cmake/FindDependency.cmake")
include("${CPSC_SOURCE_DIR}/cmake/ManualAliases.cmake")
cpsc_find_dependency(PROGRAM GIT_EXECUTABLE NAMES git REQUIRED)
find_package(Git REQUIRED)
+file(STRINGS "${CPSC_SOURCE_DIR}/cmake/CompilerPaths.txt" cpsc_compiler_paths)
+list(TRANSFORM cpsc_compiler_paths STRIP)
+list(FILTER cpsc_compiler_paths EXCLUDE REGEX "^$")
execute_process(
- COMMAND "${GIT_EXECUTABLE}" -C "${CPSC_SOURCE_DIR}" log -1 "--format=%ct:%h"
+ COMMAND "${GIT_EXECUTABLE}" -C "${CPSC_SOURCE_DIR}" log -1 "--format=%ct:%h" -- ${cpsc_compiler_paths}
OUTPUT_VARIABLE cpsc_revision
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE cpsc_git_result
)
if(NOT cpsc_git_result STREQUAL "0" OR NOT cpsc_revision MATCHES "^([0-9]+):([0-9a-f]+)$")
- message(FATAL_ERROR "Cannot read the HEAD commit for the release version")
+ message(FATAL_ERROR "Cannot read the last compiler commit for the release version")
endif()
set(ENV{SOURCE_DATE_EPOCH} "${CMAKE_MATCH_1}")
set(cpsc_short_id "${CMAKE_MATCH_2}")