6837ca808b
This commit reverts a breaking change in CMAKE_SYSTEM_NAME introduced by
"Zephyr" back to "Generic") and removes the file
`cmake/modules/Platform/Zephyr`.
Both changes in the aforementioned PR were only introduced to ultimately
modify the value of the global CMake property TARGET_SUPPORTS_SHARED_LIBS
for the special case of building for Xtensa with LLEXT.
The modification of CMAKE_SYSTEM_NAME is considered a breaking change
because it has the potential to alter the build of any non-trivial project
that previously checked for the "Generic" system identifier as
corresponding to Zephyr - for example by doing
`if (CMAKE_SYSTEM_NAME STREQUAL "Generic")`. Such builds may now break in
many ways including silently when there is no `else()` clause with a
`message()` to alert the user that a whole configuration block had been
skipped.
In essence, that CMAKE_SYSTEM_NAME modification was only introduced in
order to have CMake to load `cmake/modules/Platform/Zephyr.cmake` which in
turn adjusted the value of TARGET_SUPPORTS_SHARED_LIBS.
But the use of a CMake platform file like this is ineffective for
non-trivial projects where one or more top level CMake `project()` calls
may happen before the first call to `find_package(Zephyr)` because in such
cases CMAKE_MODULE_PATH will not have been modified yet to contain the
path to <Zephyr_ROOT>/cmake/modules and thus no platform file will be
include by CMake.
This patch moves the conditional override of TARGET_SUPPORTS_SHARED_LIBS
needed by some archs (e.g. Xtensa) into the `kernel.cmake` module which
is known to be the first call to `project()` that enables any language and
thus the one that must come before any artifact target can be defined.
Note commit
|
||
---|---|---|
.. | ||
arch_v1.cmake | ||
arch_v2.cmake | ||
basic_settings.cmake | ||
boards.cmake | ||
ccache.cmake | ||
configuration_files.cmake | ||
doc.cmake | ||
dts.cmake | ||
extensions.cmake | ||
Findarmclang.cmake | ||
FindBabbleSim.cmake | ||
FindDeprecated.cmake | ||
FindDtc.cmake | ||
FindGnuLd.cmake | ||
FindHostTools.cmake | ||
FindLlvmLld.cmake | ||
FindoneApi.cmake | ||
FindScaTools.cmake | ||
FindTargetTools.cmake | ||
FindThreads.cmake | ||
FindZephyr-sdk.cmake | ||
generated_file_directories.cmake | ||
hwm_v2.cmake | ||
kconfig.cmake | ||
kernel.cmake | ||
pre_dt.cmake | ||
python.cmake | ||
root.cmake | ||
shields.cmake | ||
snippets.cmake | ||
soc_v1.cmake | ||
soc_v2.cmake | ||
unittest.cmake | ||
user_cache.cmake | ||
version.cmake | ||
west.cmake | ||
zephyr_default.cmake | ||
zephyr_module.cmake |