Skip to content

Conversation

@tejlmand
Copy link
Contributor

…_amend().

Extend zephyr_library_amend() to support an optional directory argument.
The current zephyr_library_amend() works well when used inside a Zephyr module with same structure, but fails when the macro is called from Zephyr module integration code is located in a Zephyr MODULE_EXT_ROOT because in this case the CMake code being executed is not present in the Zephyr module itself, in which case the dir name creation based on relative to module dir give wrong result.

For this use-case then support a base directory.
This also allows for use-cases in Zephyr modules where the directory structure matching Zephyr's own structure is placed in a sub-folder.

Upstream PR#: 87274

# When called from a Zephyr module, the corresponding zephyr library defined
# within Zephyr will be looked up.
#
# <dir>: Use '<dir>' as base directory from where the Zephyr library name shall
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# <dir>: Use '<dir>' as base directory from where the Zephyr library name shall
# <dir>: Use '<dir>' as out-of-tree base directory from where the Zephyr library name shall be generated.

…_amend()

Extend `zephyr_library_amend()` to support an optional directory
argument.
The current `zephyr_library_amend()` works well when used inside a
Zephyr module with same structure, but fails when the macro is called
from Zephyr module integration code is located in a Zephyr
`MODULE_EXT_ROOT` because in this case the CMake code being executed
is not present in the Zephyr module itself, in which case the dir name
creation based on relative to module dir give wrong result.

For this use-case then support a base directory.
This also allows for use-cases in Zephyr modules where the directory
structure matching Zephyr's own structure is placed in a sub-folder.

Upstream PR #: 87274

Signed-off-by: Torsten Rasmussen <[email protected]>
@tejlmand tejlmand force-pushed the zephyr_library_amend_dir_arg branch from 8a36891 to 1019a5b Compare March 24, 2025 08:45
@tejlmand tejlmand merged commit 02dc89c into nrfconnect:main Mar 24, 2025
16 checks passed
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants