zephyr/cmake/modules
Daniel DeGrasse 0ea212918f cmake: extensions: use INTERFACE_SOURCES as property for code relocation
In order to enable code relocation, we use a custom target
(code_data_relocation_target), and add files we wish to relocate, as
well as which sections should be relocated to the COMPILE_DEFINITIONS
property for the target.

This approach has been fragile, because COMPILE_DEFINITIONS can also be
added to for all targets using `add_definitions`. This means if another
part of the project uses `add_definitions` and
CONFIG_CODE_DATA_RELOCATION is on, a warning will appear about the
"file" not being found. The "file" of course, is just the definition
added by `add_definitions`.

To work around this, switch to overloading the INTERFACE_SOURCES
property. This property should be a bit more robust, because nobody else
will add sources to the code_data_relocation_target.

However, this approach has the downside that the CMake documentation
pstates targets created with `add_custom_target()` (which the
code_data_relocation_target is) do not have an INTERFACE scope for
their sources- so while this approach works, it is not officially
supported by CMake

Fixes #60220

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-16 13:35:36 -05:00
..
FindBabbleSim.cmake
FindDeprecated.cmake cmake: add toolchain_ld_<name> macros to FindDeprecated 2024-09-16 20:18:17 +02:00
FindDtc.cmake
FindGnuLd.cmake
FindHostTools.cmake cmake: update build_info() calls to use PATH argument 2024-10-10 20:21:45 -04:00
FindLlvmLld.cmake
FindScaTools.cmake
FindTargetTools.cmake cmake: improve Zephyr link phase 2024-10-04 16:34:35 +01:00
FindThreads.cmake
FindZephyr-sdk.cmake cmake: support range for find_package(Zephyr-sdk) 2024-10-24 14:06:45 +02:00
Findarmclang.cmake
FindoneApi.cmake
arch_v1.cmake
arch_v2.cmake
basic_settings.cmake
boards.cmake cmake: scripts: support board extension 2024-10-26 17:14:06 +02:00
ccache.cmake
configuration_files.cmake cmake: support build info in Zephyr 2024-10-08 17:00:30 +02:00
doc.cmake
dts.cmake cmake: dts: Use temporary file for dts.cmake 2024-11-16 13:31:02 -05:00
extensions.cmake cmake: extensions: use INTERFACE_SOURCES as property for code relocation 2024-11-16 13:35:36 -05:00
generated_file_directories.cmake
git.cmake
hwm_v2.cmake cmake: scripts: support SoC extension 2024-10-26 17:14:06 +02:00
kconfig.cmake cmake: scripts: support board extension 2024-10-26 17:14:06 +02:00
kernel.cmake cmake: scripts: support board extension 2024-10-26 17:14:06 +02:00
pre_dt.cmake cmake: modules: dts: fix in/out docs 2024-10-03 11:40:09 +01:00
python.cmake cmake: Require Python >= 3.10 2024-09-23 10:01:20 +02:00
root.cmake
shields.cmake
snippets.cmake
soc_v1.cmake
soc_v2.cmake cmake: scripts: support SoC extension 2024-10-26 17:14:06 +02:00
unittest.cmake cmake: introduce build_info function 2024-10-08 17:00:30 +02:00
user_cache.cmake
version.cmake
west.cmake
yaml.cmake
zephyr_default.cmake
zephyr_module.cmake