CMakeLists.txt: Added default auto-detection for GEN_FILES. #836

Open
minosgalanakis wants to merge 2 commits from minosgalanakis/tools/prepare_release_lite into development
minosgalanakis commented 2026-07-09 10:15:37 -05:00 (Migrated from github.com)

Description

As part of the post release activities, fixing minor inconveniences of the tooling required to build a release.

This pr is adding an auto-detection logic to our build system to attempt to detect our source tree, and disable the default behavior of the file auto-generation.

This means that by default the files will not be auto-generated when there is not .git content, as it would be indicating that it is being consumed as part of the tar-balls.

The default user exposed behaviour set as option is still present, so if needed for other use cases they can still enable it

PR checklist

Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.

  • changelog provided | not required because:
  • framework PR provided Mbed-TLS/mbedtls-framework# | not required
  • TF-PSA-Crypto development PR provided # | not required because:
  • TF-PSA-Crypto 1.1 PR provided # | not required because:
  • mbedtls development PR provided Mbed-TLS/mbedtls#10823
  • mbedtls 4.1 PR provided Mbed-TLS/mbedtls# | not required because:
  • mbedtls 3.6 PR provided Mbed-TLS/mbedtls# | not required because:
  • tests provided | not required because:

Notes for the submitter

Please refer to the contributing guidelines, especially the
checklist for PR contributors.

Help make review efficient:

  • Multiple simple commits
    • please structure your PR into a series of small commits, each of which does one thing
  • Avoid force-push
    • please do not force-push to update your PR - just add new commit(s)
  • See our Guidelines for Contributors for more details about the review process.
## Description As part of the post release activities, fixing minor inconveniences of the tooling required to build a release. This pr is adding an auto-detection logic to our build system to attempt to detect our source tree, and disable the default behavior of the file auto-generation. This means that by default the files will not be auto-generated when there is not .git content, as it would be indicating that it is being consumed as part of the tar-balls. The default user exposed behaviour set as option is still present, so if needed for other use cases they can still enable it ## PR checklist Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line. If the provided content is part of the present PR remove the # symbol. - [ ] **changelog** provided | not required because: - [ ] **framework PR** provided Mbed-TLS/mbedtls-framework# | not required - [ ] **TF-PSA-Crypto development PR** provided # | not required because: - [ ] **TF-PSA-Crypto 1.1 PR** provided # | not required because: - [ ] **mbedtls development PR** provided Mbed-TLS/mbedtls#10823 - [ ] **mbedtls 4.1 PR** provided Mbed-TLS/mbedtls# | not required because: - [ ] **mbedtls 3.6 PR** provided Mbed-TLS/mbedtls# | not required because: - **tests** provided | not required because: ## Notes for the submitter Please refer to the [contributing guidelines](https://github.com/Mbed-TLS/TF-PSA-Crypto/blob/development/CONTRIBUTING.md), especially the checklist for PR contributors. Help make review efficient: * Multiple simple commits - please structure your PR into a series of small commits, each of which does one thing * Avoid force-push - please do not force-push to update your PR - just add new commit(s) * See our [Guidelines for Contributors](https://mbed-tls.readthedocs.io/en/latest/reviews/review-for-contributors/) for more details about the review process.
davidhorstmann-arm (Migrated from github.com) reviewed 2026-07-13 05:28:34 -05:00
davidhorstmann-arm (Migrated from github.com) left a comment
No description provided.
LGTM, thanks!
ronald-cron-arm (Migrated from github.com) requested changes 2026-07-15 02:53:03 -05:00
ronald-cron-arm (Migrated from github.com) left a comment

Some comments. Otherwise, in the PR description, please fill the PR checklist properly and remove the "Notes for the submitter" that just adds noise.

Some comments. Otherwise, in the PR description, please fill the PR checklist properly and remove the "Notes for the submitter" that just adds noise.
@ -81,15 +81,16 @@ ADD_CUSTOM_TARGET(${TF_PSA_CRYPTO_TARGET_PREFIX}tfpsacrypto-apidoc
option(ENABLE_PROGRAMS "Build TF-PSA-Crypto programs." ON)
ronald-cron-arm (Migrated from github.com) commented 2026-07-15 02:18:12 -05:00
set(tf_psa_crypto_default_gen_files ON)
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
    set(tf_psa_crypto_default_gen_files OFF)
    message(STATUS "TF-PSA-Crypto Git metadata not found; GEN_FILES defaults to OFF.")
elseif(CMAKE_HOST_WIN32)
     set(tf_psa_crypto_default_gen_files OFF)
endif()

local variable thus rather lower case. Otherwise, I am suggesting a simplification of the logic.

```suggestion set(tf_psa_crypto_default_gen_files ON) if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") set(tf_psa_crypto_default_gen_files OFF) message(STATUS "TF-PSA-Crypto Git metadata not found; GEN_FILES defaults to OFF.") elseif(CMAKE_HOST_WIN32) set(tf_psa_crypto_default_gen_files OFF) endif() ``` local variable thus rather lower case. Otherwise, I am suggesting a simplification of the logic.
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'minosgalanakis/tools/prepare_release_lite:minosgalanakis/tools/prepare_release_lite'
git switch 'minosgalanakis/tools/prepare_release_lite'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'development'
git merge --no-ff 'minosgalanakis/tools/prepare_release_lite'
git switch 'minosgalanakis/tools/prepare_release_lite'
git rebase 'development'
git switch 'development'
git merge --ff-only 'minosgalanakis/tools/prepare_release_lite'
git switch 'minosgalanakis/tools/prepare_release_lite'
git rebase 'development'
git switch 'development'
git merge --no-ff 'minosgalanakis/tools/prepare_release_lite'
git switch 'development'
git merge --squash 'minosgalanakis/tools/prepare_release_lite'
git switch 'development'
git merge --ff-only 'minosgalanakis/tools/prepare_release_lite'
git switch 'development'
git merge 'minosgalanakis/tools/prepare_release_lite'
git push origin 'development'
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-Mbed-TLS/TF-PSA-Crypto!836
No description provided.