zephyr/cmake/modules
Nicolas Lebedenco 6837ca808b cmake: Revert breaking change to CMAKE_SYSTEM_NAME
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 64e7d85 added a Kconfig to specify the object type of llext
being built, so it's not tied to the arch anymore but to the
CONFIG_LLEXT_TYPE_ELF_SHAREDLIB option.

Signed-off-by: Nicolas Lebedenco <nicolas@lebedenco.net>
2024-04-29 16:17:39 +02:00
..
arch_v1.cmake hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00
arch_v2.cmake hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00
basic_settings.cmake cmake: extend zephyr_get() to handle build configurations from sysbuild 2022-09-02 15:16:50 +02:00
boards.cmake cmake: boards: Fix missing board name 2024-04-24 14:55:18 -04:00
ccache.cmake cmake: Zephyr CMake package and CMake modules 2022-02-22 10:02:39 -08:00
configuration_files.cmake cmake: modules: configuration_files: Add support for soc overlays 2024-04-29 15:08:35 +01:00
doc.cmake cmake: doc: created a doc.cmake CMake module in Zephyr CMake modules dir 2022-02-22 10:02:39 -08:00
dts.cmake cmake: support shortened file names for single SoC boards 2024-04-09 23:35:54 +02:00
extensions.cmake cmake: Add support for socs folder and Kconfig fragments 2024-04-29 15:08:35 +01:00
Findarmclang.cmake cmake: armclang version detection 2023-09-13 16:23:30 +02:00
FindBabbleSim.cmake nrf5_bsim cmake: Check that the simulator version is new enough 2024-03-19 21:18:13 -05:00
FindDeprecated.cmake hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00
FindDtc.cmake cmake: cleanup search for devicetree compiler, dtc 2022-09-01 15:59:43 +02:00
FindGnuLd.cmake cmake: Normalize GNULD_LINKER variable 2024-04-16 16:38:35 -07:00
FindHostTools.cmake hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00
FindLlvmLld.cmake cmake: Fix FindLlvmLld usage of unimported package 2023-06-26 12:40:03 +00:00
FindoneApi.cmake cmake: Fix FindLlvmLld usage of unimported package 2023-06-26 12:40:03 +00:00
FindScaTools.cmake cmake: implement build infrastructure for supporting SCA tools. 2023-01-27 20:28:58 +09:00
FindTargetTools.cmake cmake: Revert breaking change to CMAKE_SYSTEM_NAME 2024-04-29 16:17:39 +02:00
FindThreads.cmake cmake: modules: Introduce FindThreads module 2024-04-29 15:59:42 +02:00
FindZephyr-sdk.cmake ARC: MWDT: rework GNU helper tools usage 2023-06-17 07:44:31 -04:00
generated_file_directories.cmake cmake: modules: generated_file_directories: fix paths 2024-01-30 12:36:11 +01:00
hwm_v2.cmake sysbuild: add SoC-specific sysbuild configuration 2024-04-10 17:53:24 +02:00
kconfig.cmake scripts: remove boards_legacy sub-folder from list_boards.py 2024-03-22 11:51:58 +01:00
kernel.cmake cmake: Revert breaking change to CMAKE_SYSTEM_NAME 2024-04-29 16:17:39 +02:00
pre_dt.cmake hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00
python.cmake cmake: drop ERROR_QUIET in python.cmake 2023-12-13 13:56:59 +01:00
root.cmake cmake: boards: Fix issue with relative paths 2023-06-15 05:10:42 -04:00
shields.cmake cmake: shields: Simplify shield processing, print shields from modules 2024-04-12 15:03:29 +02:00
snippets.cmake cmake: support snippets scope for zephyr_get() 2023-05-25 13:31:53 +00:00
soc_v1.cmake hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00
soc_v2.cmake cmake: add CMake configure dependency to board.yml 2024-03-22 13:02:00 +00:00
unittest.cmake unittest: update unittest to hwmv2 2024-03-22 11:51:58 +01:00
user_cache.cmake cmake: Fix USER_CACHE_DIR path generation 2023-05-10 15:27:54 +02:00
version.cmake cmake: fix issue with parsing version file located in /VERSION 2024-04-15 14:05:38 +02:00
west.cmake cmake: cleanup old west version support 2023-08-24 10:47:00 +02:00
zephyr_default.cmake hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00
zephyr_module.cmake cmake: Introduce ZEPHYR_CURRENT_MODULE_NAME 2024-01-24 10:54:17 +01:00