Add the ability to skip generation of git and date data (#3800)
This can be done by setting the `CHATTERINO_SKIP_DATE_GEN` and `CHATTERINO_SKIP_GIT_GEN` environment variables
This commit is contained in:
@@ -19,6 +19,10 @@ set(GIT_COMMIT "GIT-REPOSITORY-NOT-FOUND")
|
|||||||
set(GIT_RELEASE "${PROJECT_VERSION}")
|
set(GIT_RELEASE "${PROJECT_VERSION}")
|
||||||
set(GIT_MODIFIED 0)
|
set(GIT_MODIFIED 0)
|
||||||
|
|
||||||
|
if (DEFINED ENV{CHATTERINO_SKIP_GIT_GEN})
|
||||||
|
return()
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (GIT_EXECUTABLE)
|
if (GIT_EXECUTABLE)
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${GIT_EXECUTABLE} rev-parse --is-inside-work-tree
|
COMMAND ${GIT_EXECUTABLE} rev-parse --is-inside-work-tree
|
||||||
|
|||||||
+5
-1
@@ -622,7 +622,11 @@ set_target_properties(${LIBRARY_PROJECT}
|
|||||||
# compilation in CMake is a more involved, as documented in https://stackoverflow.com/q/24292898.
|
# compilation in CMake is a more involved, as documented in https://stackoverflow.com/q/24292898.
|
||||||
# For CI runs, however, the date of build file generation should be consistent with the date of
|
# For CI runs, however, the date of build file generation should be consistent with the date of
|
||||||
# compilation so this approximation is "good enough" for our purpose.
|
# compilation so this approximation is "good enough" for our purpose.
|
||||||
string(TIMESTAMP cmake_gen_date "%Y-%m-%d")
|
if (DEFINED ENV{CHATTERINO_SKIP_DATE_GEN})
|
||||||
|
set(cmake_gen_date "1970-01-01")
|
||||||
|
else ()
|
||||||
|
string(TIMESTAMP cmake_gen_date "%Y-%m-%d")
|
||||||
|
endif ()
|
||||||
|
|
||||||
target_compile_definitions(${LIBRARY_PROJECT} PUBLIC
|
target_compile_definitions(${LIBRARY_PROJECT} PUBLIC
|
||||||
CHATTERINO
|
CHATTERINO
|
||||||
|
|||||||
Reference in New Issue
Block a user