On my end, the default length for the abbreviated commit hash is 9 characters.
This won't fit into uint32_t (4 bytes).
Instead change FW_COMMIT_HASH into a string
and create preprocessor symbol for the string length
such that it's known at compile time.
If the string should be longer or shorter
then only FW_COMMIT_HASH_LENGTH needs to be configured on the CMake side
Drop the ALPHA/BETA/custom version handling. Set the version string and
firmware date based on the current tree description which has all the
required details.
Allow to override the repository information via cmake.
Use a truncated commit hash to set the internal commit number for
compatibility.
Rebase and fix issues
- Use the HEAD commit hash as the default suffix
- Use the output of "describe" as the full version string
- Use the HEAD commit time as SOURCE_DATE_EPOCH
Allow to set the source epoch of the build with
PROJECT_VERSION_TIMESTAMP.
When unset fetch the commit timestamp of the current HEAD automatically
instead of leaving the source as 0. This fixes the firmware DATE
information in the support menu.
- Use ALL_MULTILANG and VARIANT_MULTILANG instead of VARIANT_Multilang
- Use ALL_ENGLISH and VARIANT_ENGLISH instead of VARIANT_En-only
- Rename the intermediate VARIANT_Multilang_* targets to VARIANT_lang_*
to avoid confusion
The cmake build system is effectively on-par (and a lot better in most
areas) compared to the old build system.
There's no need to warn developers anymore.
The option SECONDARY_LANGUAGES is no longer being used.
cmake always allows en/multilang for all selected variants
by using the appropriate target now (ALL_ENGLISH).
Add the following macro targets to check translations:
- check_lang: check all languages for all variants
- check_lang_[variant]: check all languages for [variant]
- check_lang_[lang]: check all variants against [lang]
- check_lang_[variant]_[lang]: check a single variant/language
For example:
- ninja check_lang: check *everything*
- ninja check_de: check German in all variants
- ninja check_MK3S-EINSy10a: check all languages in the MK3S
- ninja check_MK3S-EINSy10a_de: check German in the MK3S
Rewrite cmake rules for reproducibility and move them inside a separate
module.
The new rules are cleaner and can operate on multi-directory projects
transparently.