Commit Graph

83 Commits

Author SHA1 Message Date
Guðni Már Gilbert 69e06bac84 Use FW_COMMIT_HASH_UNKNOWN in CMakeLists.txt 2023-10-08 12:59:09 +00:00
Guðni Már Gilbert 6aae8f04df Fix two python commands on Windows 2023-10-07 21:29:24 +00:00
Guðni Már Gilbert 415c0c79d1 Fix FW_COMMIT_HASH compiler warning
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
2023-10-07 21:01:28 +00:00
VintagePC 52de576e0a change where FW_VERSION_FULL is defined so it's less messy 2023-09-23 13:10:04 -04:00
vintagepc 4b66485f46
Fix leading v 2023-09-22 21:48:22 -04:00
VintagePC 20540cc61b Set repository, if possible. 2023-09-22 17:57:41 -04:00
VintagePC a6d1985742 -Clear project timestamp if git was not used/found
-Add git as a runner tool for versioning
2023-09-22 17:22:05 -04:00
VintagePC a5aab6afd9 Fix PROJECT_VERSION_FULL if git is not available 2023-09-22 17:13:13 -04:00
VintagePC 2b5e2dc9fe fix commit number handling 2023-09-11 18:53:20 -04:00
VintagePC f1ab89183d improve handling of invalid COMMIT_DSC 2023-09-11 18:24:52 -04:00
VintagePC 251e4ff370 Add default-off option to enforce config.h checks 2023-09-11 18:07:00 -04:00
VintagePC 2485c36391 Add dev status handling 2023-09-09 13:19:11 -04:00
VintagePC ab299e36d1 Use commit number as version tweak value 2023-09-07 19:38:07 -04:00
VintagePC 916d02824e Initial round of changes to address some cmake features 2023-09-07 18:46:47 -04:00
VintagePC 3673b68356 Fix rebase fallout 2023-09-04 08:40:51 -04:00
Yuri D'Elia 334bfe4d29 build: Set all version data based on git tags
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
2023-09-04 08:35:15 -04:00
Yuri D'Elia 80594880cd cmake: Simplify version handling based on git tags
- 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
2023-09-04 08:35:15 -04:00
Yuri D'Elia 2a71e681db cmake: Cache CUSTOM_COMPILE_OPTIONS
This allows persisting custom flags across builds, as intended.
2023-08-18 14:30:10 +02:00
Yuri D'Elia cfc8ffe8a3 cmake: Set source epoch from the HEAD commit
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.
2023-08-17 07:46:47 +02:00
Yuri D'Elia a73fdec4ef cmake: Remove prefix/suffix exceptions
Now handled by having shorter variant names
2023-07-26 16:40:26 +02:00
Guðni Már Gilbert 526a1dcc63 power panic: Move code into a separate file 2023-07-18 11:29:03 +02:00
Scott Mudge 3cd125c566
MeatPack gcode compression support 2023-04-13 10:50:15 +02:00
D.R.racer 43ae2c78e5 Fix cmake build 2023-01-31 09:35:22 +01:00
Guðni Már Gilbert 15932123db cmake: add target name to memory usage info 2023-01-28 18:35:06 +00:00
Guðni Már Gilbert 17e6f1b75e optimisation: remove conv2str.cpp
Change in memory:
Flash: -288 bytes
SRAM: -8 bytes
2023-01-25 06:28:00 +00:00
Guðni Már Gilbert 11f56bf900 Fix building multilang firmware on Windows 2023-01-14 09:20:55 +00:00
Yuri D'Elia abf7fbf99b cmake: Consistent target names
- 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
2022-12-29 12:47:21 +01:00
Guðni Már Gilbert 355b670cd4 Remove SWSPI which is not used/implemented 2022-12-20 10:10:45 +01:00
Yuri D'Elia 5160e214ae
Merge branch 'MK3' into build_drop_unused_option 2022-12-08 18:32:32 +01:00
Yuri D'Elia bfc44251c6 cmake: Remove usage warning
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.
2022-12-08 13:41:51 +01:00
Yuri D'Elia 138725325a cmake: Remove unused SECONDARY_LANGUAGES option
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).
2022-12-07 16:00:32 +01:00
Yuri D'Elia 688542602d cmake: Add targets for language checking
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
2022-10-13 20:24:19 +02:00
Yuri D'Elia 468f4f8c57 cmake: Always check po files for errors during build 2022-10-13 20:20:47 +02:00
Yuri D'Elia 036a04938d cmake: Introduce AvrGcc/AnyAvrGcc toolchains, replacing LocalAvrGcc
- AvrGcc: use avr-gcc from dependencies
- AnyAvrGcc: use system's avr-gcc for testing
2022-10-12 11:07:45 +02:00
Yuri D'Elia 8a00179528 cmake: Improved reproducibility rules
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.
2022-10-10 14:19:03 +02:00
Yuri D'Elia 896008cee4 cmake: Remove unneeded additional include path 2022-10-05 11:10:05 +02:00
Yuri D'Elia d867da201f cmake: Define FW_VARIANT instead of copying Configuration_prusa 2022-10-05 01:26:30 +02:00
Yuri D'Elia 5237365ff7 cmake: Fix existing comment 2022-10-04 22:55:33 +02:00
Yuri D'Elia c479e002d4 cmake: Hard-link final hex files to reduce space overhead
cmake 3.19 introduced support for hardlinks, so use them instead of
making a copy.
2022-10-04 01:13:14 +02:00
Yuri D'Elia 0dbf08b8db cmake: Cleanup the final dual-language hex
List the file as a byproduct of the rule for correct cleanup.
2022-10-04 00:18:14 +02:00
Yuri D'Elia 96a2c9cb4a cmake: Improve a few comments 2022-10-03 23:57:00 +02:00
Yuri D'Elia 75377f3081 cmake: Use/include Buddy formatting rules for consistency 2022-10-03 23:54:24 +02:00
Yuri D'Elia 0b23ab8e09 cmake: Fix/uniform non-xflash builds 2022-10-03 23:53:05 +02:00
Yuri D'Elia 9d716e9d69 cmake: Move a few variables closer to usage 2022-10-03 23:53:05 +02:00
Yuri D'Elia 3ec54d355e cmake: Correctly patch binary during multi-language builds
lang-map.py expects to use the BIN file as an input-output argument.
The resulting BIN file contains an updated _PRI_LANG_SIGNATURE symbol.
2022-10-03 23:53:05 +02:00
Yuri D'Elia ac1fca4a6a cmake: Generate .hex files only where needed
This avoids generating useless intermediate .hex files during
multi-language builds.
2022-10-03 23:53:05 +02:00
Yuri D'Elia ac84dd1457 cmake: Update the variant configuration correctly when changed 2022-10-03 20:55:27 +02:00
Yuri D'Elia 7d9dc1007c cmake: Cleanup XFLASH multi-language rules 2022-10-03 19:51:41 +02:00
Yuri D'Elia 7e56a8255b cmake: Define all targets, but only build ALL_MULTILANG by default
ALL_ENGLISH is mostly intended for debugging purposes
2022-10-03 17:51:31 +02:00
Yuri D'Elia 63605f4c86 cmake: Reformat to fix tab/space mixture 2022-10-03 17:40:48 +02:00