Define Git and date constants in executables only (#4681)
This commit is contained in:
@@ -185,6 +185,16 @@ if (BUILD_WITH_CRASHPAD)
|
||||
add_subdirectory("${CMAKE_SOURCE_DIR}/lib/crashpad" EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
# Used to provide a date of build in the About page (for nightly builds). Getting the actual time of
|
||||
# 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
|
||||
# compilation so this approximation is "good enough" for our purpose.
|
||||
if (DEFINED ENV{CHATTERINO_SKIP_DATE_GEN})
|
||||
set(cmake_gen_date "1970-01-01")
|
||||
else ()
|
||||
string(TIMESTAMP cmake_gen_date "%Y-%m-%d")
|
||||
endif ()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user