Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: tfm: moving CMake execution of tfm_cmake to a custom command #36183

Merged
merged 1 commit into from
Jun 11, 2021

Conversation

tejlmand
Copy link
Collaborator

Fixes: #36101

The move of CMake invocation to a dedicated custom target, see #34868
results in tfm_cmake to always be considered out-of-date, causing CMake
to be reinvoked in the TF-M Binary dir, which again results in the
build command to rebuild.

This commit moves the invocation to a custom command with the
CMakeCache.txt as output. The custom target tfm_cmake is updated to
depend on CMakeCache.txt.

This mean that CMake for TF-M will only be invoked inside the Zephyr build
command if that file is missing.

If the CMakeCache.txt file is updated or TF-M CMake or source code is
modified, then the build command inside the TF-M build folder will
ensure correct re-run of CMake from within the TF-M build folder.

This ensures that TF-M will still rebuild if TF-M code is modified,
while at the same time avoid unnecessary rebuilds of TF-M code.

Signed-off-by: Torsten Rasmussen Torsten.Rasmussen@nordicsemi.no

@tejlmand tejlmand added the bug The issue is a bug, or the PR is fixing a bug label Jun 11, 2021
Fixes: zephyrproject-rtos#36101

The move of CMake invocation to a dedicated custom target, see zephyrproject-rtos#34868
results in tfm_cmake to always be considered out-of-date, causing CMake
to be reinvoked in the TF-M Binary dir, which again results in the
build command to rebuild.

This commit moves the invocation to a custom command with the
CMakeCache.txt as output. The custom target tfm_cmake is updated to
depend on CMakeCache.txt.

This mean that CMake for TF-M will only be invoked inside the Zephyr
build command if that file is missing.

If the CMakeCache.txt file is updated or TF-M CMake or source code is
modified, then the build command inside the TF-M build folder will
ensure correct re-run of CMake from within the TF-M build folder.

This ensures that TF-M will still rebuild if TF-M code is modified,
while at the same time avoid unnecessary rebuilds of TF-M code.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
@tejlmand tejlmand force-pushed the issues/36101_tfm_rebuild branch from 682f1fd to 98f2cd2 Compare June 11, 2021 19:52
@ioannisg ioannisg self-assigned this Jun 11, 2021
@galak galak merged commit 7cc52f8 into zephyrproject-rtos:main Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Modules bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tfm related build rebuild even if nothing changes
3 participants