Skip to content

Commit

Permalink
Zephyr integration: Add support for POSIX architecture
Browse files Browse the repository at this point in the history
When building for CMAKE_SYSTEM_PROCESSOR will be set to
"posix" which is not usefull. Let's rename it instead
to something else we can use.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
  • Loading branch information
aescolar committed Oct 13, 2023
1 parent bcd9cfa commit 9854dcf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,13 @@ set(WITH_ZEPHYR_LIB 1)
set(WITH_DOC OFF CACHE BOOL "" FORCE)
set(WITH_DEFAULT_LOGGER OFF CACHE BOOL "" FORCE)

if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "posix")
# When building Zephyr for the POSIX architecture
# CMAKE_SYSTEM_PROCESSOR is set to POSIX. We need
# to set it instead to "hosted" which is what the
# libmetal build specs for such a target.
set(CMAKE_SYSTEM_PROCESSOR "hosted")
endif()

add_subdirectory(${CONFIG_LIBMETAL_SRC_PATH} libmetal)
endif()

0 comments on commit 9854dcf

Please sign in to comment.