From c4266a8cd2f00e380caf7277ee9a213871a2a5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B8e?= Date: Tue, 23 Oct 2018 12:00:47 +0200 Subject: [PATCH] cmake: Move MDK-defines from 'soc' to the MDK build script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The build script ext/hal/nordic/CMakeLists.txt manages the MDK dependency. The MDK is not aware of Zephyr and uses it's own defines to indicate what HW we are building for. This commit moves these MDK-specific defines out of the 'soc' build scripts and into the MDK build script where they belong. This is expected to be a pure refactoring without side-effects. Signed-off-by: Sebastian Bøe --- ext/hal/nordic/CMakeLists.txt | 6 ++++++ soc/arm/nordic_nrf/nrf51/CMakeLists.txt | 3 ++- soc/arm/nordic_nrf/nrf52/CMakeLists.txt | 4 ---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ext/hal/nordic/CMakeLists.txt b/ext/hal/nordic/CMakeLists.txt index b3cbb58430e..599b750b267 100644 --- a/ext/hal/nordic/CMakeLists.txt +++ b/ext/hal/nordic/CMakeLists.txt @@ -11,6 +11,12 @@ if(CONFIG_HAS_NRFX) zephyr_include_directories(nrfx/mdk) zephyr_include_directories(.) + # Define MDK defines globally + zephyr_compile_definitions_ifdef(CONFIG_SOC_SERIES_NRF51X NRF51) + zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52810 NRF52810_XXAA) + zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52832 NRF52832_XXAA) + zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52840 NRF52840_XXAA) + zephyr_sources_ifdef(CONFIG_SOC_SERIES_NRF51X nrfx/mdk/system_nrf51.c) zephyr_sources_ifdef(CONFIG_SOC_NRF52810 nrfx/mdk/system_nrf52810.c) zephyr_sources_ifdef(CONFIG_SOC_NRF52832 nrfx/mdk/system_nrf52.c) diff --git a/soc/arm/nordic_nrf/nrf51/CMakeLists.txt b/soc/arm/nordic_nrf/nrf51/CMakeLists.txt index bdbeda41ac9..ded8998516a 100644 --- a/soc/arm/nordic_nrf/nrf51/CMakeLists.txt +++ b/soc/arm/nordic_nrf/nrf51/CMakeLists.txt @@ -1,6 +1,7 @@ +# NB: The define 'NRF51822' is deprecated. 'NRF51' should be used in +# it's place. zephyr_compile_definitions_ifdef( CONFIG_SOC_SERIES_NRF51X - NRF51 NRF51822 ) diff --git a/soc/arm/nordic_nrf/nrf52/CMakeLists.txt b/soc/arm/nordic_nrf/nrf52/CMakeLists.txt index 5648b7d0322..1a6e4689b49 100644 --- a/soc/arm/nordic_nrf/nrf52/CMakeLists.txt +++ b/soc/arm/nordic_nrf/nrf52/CMakeLists.txt @@ -1,7 +1,3 @@ -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52810 NRF52810_XXAA) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52832 NRF52832_XXAA) -zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF52840 NRF52840_XXAA) - zephyr_sources( power.c soc.c