Skip to content

cmake: Fix dependencies for LD script generation #13182

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

Merged

Conversation

SebastianBoe
Copy link
Collaborator

The dependencies relating to generating LD scripts are declared
incorrectly. This manifests itself as broken incremental builds as
shown in #13001.

This commit aligns the LD script generation with the Zephyr standard
for declaring custom commands.

For instance, custom commands should generate files that are wrapped
by targets. The custom commands should declare the dependencies, not
the targets.

Also, when using custom commands, the OUTPUT signature should be used,
not the TARGET signature, as app_smem was doing.

For details about how Zephyr uses custom commands see
https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/

This fixes #13001.

This commit applies various refactorings and whitespace fixes in
preparation for the patch that fixes zephyrproject-rtos#13001.

It includes changing indentation from tabs to spaces and splitting
tokens across more lines to increase readability and minimize patch
sizes.

Signed-off-by: Sebastian Bøe <[email protected]>
To be able to correctly express that preprocessing a file will depend
on targets and files we enhance the LD script preprocessing function
by adding all trailing arguments to the DEPENDS section of the custom
command.

Signed-off-by: Sebastian Bøe <[email protected]>
The dependencies relating to generating LD scripts are declared
incorrectly. This manifests itself as broken incremental builds as
shown in zephyrproject-rtos#13001.

This commit aligns the LD script generation with the Zephyr standard
for declaring custom commands.

For instance, custom commands should generate files that are wrapped
by targets. The custom commands should declare the dependencies, not
the targets.

Also, when using custom commands, the OUTPUT signature should be used,
not the TARGET signature, as app_smem was doing.

For details about how Zephyr uses custom commands see
https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/

This fixes zephyrproject-rtos#13001.

Signed-off-by: Sebastian Bøe <[email protected]>
@andrewboie
Copy link
Contributor

Thanks for looking into this, will do some tests later today

@galak galak merged commit 2a96312 into zephyrproject-rtos:master Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

app shared memory rules in CMakeLists.txt breaks incremental builds
3 participants