summaryrefslogtreecommitdiff
path: root/examples/build_system
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2025-01-26 00:24:25 +0700
committerGitHub <[email protected]>2025-01-26 00:24:25 +0700
commit0d4f945bdce5bbe47feab51b2a77a26f30aac0bd (patch)
treeae8b33a10bf1a13b70de459796da9f78494e6b19 /examples/build_system
parent37e6f496197e0bc35ca0f71cfef80c19be273ca3 (diff)
parent882cb1406d19a3a16d530ec8bd5d8fb7571a4eef (diff)
Merge pull request #2962 from hathach/zephyr-support
Initial Zephyr support
Diffstat (limited to 'examples/build_system')
-rw-r--r--examples/build_system/cmake/toolchain/arm_gcc.cmake4
-rw-r--r--examples/build_system/cmake/toolchain/common.cmake5
2 files changed, 7 insertions, 2 deletions
diff --git a/examples/build_system/cmake/toolchain/arm_gcc.cmake b/examples/build_system/cmake/toolchain/arm_gcc.cmake
index 0b0949dd8..6a660e259 100644
--- a/examples/build_system/cmake/toolchain/arm_gcc.cmake
+++ b/examples/build_system/cmake/toolchain/arm_gcc.cmake
@@ -1,3 +1,7 @@
+if (RTOS STREQUAL zephyr)
+ return()
+endif ()
+
if (NOT DEFINED CMAKE_C_COMPILER)
set(CMAKE_C_COMPILER "arm-none-eabi-gcc")
endif ()
diff --git a/examples/build_system/cmake/toolchain/common.cmake b/examples/build_system/cmake/toolchain/common.cmake
index 688715914..4c181137b 100644
--- a/examples/build_system/cmake/toolchain/common.cmake
+++ b/examples/build_system/cmake/toolchain/common.cmake
@@ -4,6 +4,7 @@ include(CMakePrintHelpers)
# Common
# ----------------------------------------------------------------------------
set(CMAKE_SYSTEM_NAME Generic)
+set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_CPU})
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
# Look for includes and libraries only in the target system prefix.
@@ -13,8 +14,8 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# pass TOOLCHAIN_CPU to
-set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_SYSTEM_PROCESSOR)
-include(${CMAKE_CURRENT_LIST_DIR}/../cpu/${CMAKE_SYSTEM_PROCESSOR}.cmake)
+set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_SYSTEM_PROCESSOR CMAKE_SYSTEM_CPU)
+include(${CMAKE_CURRENT_LIST_DIR}/../cpu/${CMAKE_SYSTEM_CPU}.cmake)
# ----------------------------------------------------------------------------
# Compile flags