[calamares] Try to reduce compile-churn with version header

- Very rarely do we need the full-git-version of Calamares,
  so split that into a separate header with a little trickery.
- In the "normal" version header, drop the full-git-version values.
This commit is contained in:
Adriaan de Groot 2020-07-28 14:59:36 +02:00
parent b06498194e
commit 9568fc082f
3 changed files with 19 additions and 2 deletions

View File

@ -537,7 +537,11 @@ if( CALAMARES_VERSION_RC )
set( CALAMARES_VERSION ${CALAMARES_VERSION}rc${CALAMARES_VERSION_RC} )
endif()
# additional info for non-release builds
# Additional info for non-release builds. The "extended" version information
# with date and git information (commit, dirty status) is used only
# by CalamaresVersionX.h, which is included by consumers that need a full
# version number with all that information; normal consumers can include
# CalamaresVersion.h with more stable numbers.
if( NOT BUILD_RELEASE AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git/" )
include( CMakeDateStamp )
set( CALAMARES_VERSION_DATE "${CMAKE_DATESTAMP_YEAR}${CMAKE_DATESTAMP_MONTH}${CMAKE_DATESTAMP_DAY}" )

View File

@ -4,7 +4,7 @@
#cmakedefine CALAMARES_ORGANIZATION_NAME "${CALAMARES_ORGANIZATION_NAME}"
#cmakedefine CALAMARES_ORGANIZATION_DOMAIN "${CALAMARES_ORGANIZATION_DOMAIN}"
#cmakedefine CALAMARES_APPLICATION_NAME "${CALAMARES_APPLICATION_NAME}"
#cmakedefine CALAMARES_VERSION "${CALAMARES_VERSION}"
#cmakedefine CALAMARES_VERSION "${CALAMARES_VERSION_SHORT}"
#cmakedefine CALAMARES_VERSION_SHORT "${CALAMARES_VERSION_SHORT}"
#cmakedefine CALAMARES_VERSION_MAJOR "${CALAMARES_VERSION_MAJOR}"

View File

@ -0,0 +1,13 @@
// Same as CalamaresVersion.h, but with a full-git-extended VERSION
// rather than the short (vM.m.p) semantic version.
#ifndef CALAMARES_VERSION_H
// On purpose, do not define the guard, but let CalamaresVersion.h do it
// #define CALAMARES_VERSION_H
#include "CalamaresVersion.h"
#undef CALAMARES_VERSION
#cmakedefine CALAMARES_VERSION "${CALAMARES_VERSION}"
#endif // CALAMARES_VERSION_H