From cec86fc1507d5241cbf4abef1102e4945f77a73e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 24 Jan 2019 17:26:08 +0000 Subject: [PATCH] Fix to includes handling of ChibiOS-Contrib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The include order DOES MATTER: need to add our overlay before the ChibiOS-Contrib otherwise it won't pickup the correct header. Signed-off-by: José Simões --- CMake/Modules/FindChibiOS-Contrib.cmake | 14 ++++++++------ targets/CMSIS-OS/ChibiOS/MBN_QUAIL/CMakeLists.txt | 2 +- .../CMSIS-OS/ChibiOS/NETDUINO3_WIFI/CMakeLists.txt | 2 +- .../ChibiOS/ST_NUCLEO64_F091RC/CMakeLists.txt | 2 +- .../ChibiOS/ST_STM32F429I_DISCOVERY/CMakeLists.txt | 2 +- .../ChibiOS/ST_STM32F769I_DISCOVERY/CMakeLists.txt | 2 +- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CMake/Modules/FindChibiOS-Contrib.cmake b/CMake/Modules/FindChibiOS-Contrib.cmake index 77fffd5147..e62252790d 100644 --- a/CMake/Modules/FindChibiOS-Contrib.cmake +++ b/CMake/Modules/FindChibiOS-Contrib.cmake @@ -5,7 +5,8 @@ # set include directories for ChibiOS-Contrib -list(APPEND CHIBIOS_CONTRIB_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS-Contrib_Source/os/hal/include/) +# the path is one folder UP from the includes directory to allow a selective inclusion of our own hal_community.h +list(APPEND CHIBIOS_CONTRIB_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS-Contrib_Source/os/hal) #################################################################################### # WHEN ADDING A NEW ChibiOS-Contrib component add the include directory(ies) bellow @@ -14,11 +15,12 @@ list(APPEND CHIBIOS_CONTRIB_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS-Contrib_S #list(APPEND CHIBIOS_CONTRIB_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS-Contrib_Source/os/hal/include/IMACOMPONENT) -####################################################################################################################################### -# Because we've "hacked" ChibiOS overlay mechanism used by the community contributions we can't add the "official" hal_community.c -# Instead we have to add the requried and equivalent calls existing in the official source file -# in our hal_community.c @ targets\CMSIS-OS\ChibiOS\nf-overlay\os\hal\src\hal_community.c -######################################################################################################################### +#################################################################################################################################### +# Because we've "hacked" ChibiOS overlay mechanism used by the community contributions we can't add the "official" hal_community.c # +# Instead we have to add the required and equivalent calls that exist in the official source file # +# in our hal_community.c @ targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/src/hal_community.c # +# the include paths are to be added to our hal_community.h @ targets/CMSIS-OS/ChibiOS/nf-overlay/os/hal/include/hal_community.h # +#################################################################################################################################### #################################################################################################### diff --git a/targets/CMSIS-OS/ChibiOS/MBN_QUAIL/CMakeLists.txt b/targets/CMSIS-OS/ChibiOS/MBN_QUAIL/CMakeLists.txt index d9b9ef6f6d..4b3953d41d 100644 --- a/targets/CMSIS-OS/ChibiOS/MBN_QUAIL/CMakeLists.txt +++ b/targets/CMSIS-OS/ChibiOS/MBN_QUAIL/CMakeLists.txt @@ -140,8 +140,8 @@ include_directories( ${WireProtocol_INCLUDE_DIRS} ${CHIBIOS_INCLUDE_DIRS} - ${CHIBIOS_CONTRIB_INCLUDE_DIRS} ${ChibiOSnfOverlay_INCLUDE_DIRS} + ${CHIBIOS_CONTRIB_INCLUDE_DIRS} ${TARGET_CMSIS_COMMON_INCLUDE_DIRS} ${TARGET_CHIBIOS_COMMON_INCLUDE_DIRS} diff --git a/targets/CMSIS-OS/ChibiOS/NETDUINO3_WIFI/CMakeLists.txt b/targets/CMSIS-OS/ChibiOS/NETDUINO3_WIFI/CMakeLists.txt index a1a9dd99a7..f78fa9f2f9 100644 --- a/targets/CMSIS-OS/ChibiOS/NETDUINO3_WIFI/CMakeLists.txt +++ b/targets/CMSIS-OS/ChibiOS/NETDUINO3_WIFI/CMakeLists.txt @@ -143,8 +143,8 @@ include_directories( ${WireProtocol_INCLUDE_DIRS} ${CHIBIOS_INCLUDE_DIRS} - ${CHIBIOS_CONTRIB_INCLUDE_DIRS} ${ChibiOSnfOverlay_INCLUDE_DIRS} + ${CHIBIOS_CONTRIB_INCLUDE_DIRS} ${TARGET_CMSIS_COMMON_INCLUDE_DIRS} ${TARGET_CHIBIOS_COMMON_INCLUDE_DIRS} diff --git a/targets/CMSIS-OS/ChibiOS/ST_NUCLEO64_F091RC/CMakeLists.txt b/targets/CMSIS-OS/ChibiOS/ST_NUCLEO64_F091RC/CMakeLists.txt index 54dfdecace..a04e8c0b60 100644 --- a/targets/CMSIS-OS/ChibiOS/ST_NUCLEO64_F091RC/CMakeLists.txt +++ b/targets/CMSIS-OS/ChibiOS/ST_NUCLEO64_F091RC/CMakeLists.txt @@ -137,8 +137,8 @@ include_directories( ${WireProtocol_INCLUDE_DIRS} ${CHIBIOS_INCLUDE_DIRS} - ${CHIBIOS_CONTRIB_INCLUDE_DIRS} ${ChibiOSnfOverlay_INCLUDE_DIRS} + ${CHIBIOS_CONTRIB_INCLUDE_DIRS} ${TARGET_CMSIS_COMMON_INCLUDE_DIRS} ${TARGET_CHIBIOS_COMMON_INCLUDE_DIRS} diff --git a/targets/CMSIS-OS/ChibiOS/ST_STM32F429I_DISCOVERY/CMakeLists.txt b/targets/CMSIS-OS/ChibiOS/ST_STM32F429I_DISCOVERY/CMakeLists.txt index 1fa323c267..e0882b2eef 100644 --- a/targets/CMSIS-OS/ChibiOS/ST_STM32F429I_DISCOVERY/CMakeLists.txt +++ b/targets/CMSIS-OS/ChibiOS/ST_STM32F429I_DISCOVERY/CMakeLists.txt @@ -138,8 +138,8 @@ include_directories( ${WireProtocol_INCLUDE_DIRS} ${CHIBIOS_INCLUDE_DIRS} - ${CHIBIOS_CONTRIB_INCLUDE_DIRS} ${ChibiOSnfOverlay_INCLUDE_DIRS} + ${CHIBIOS_CONTRIB_INCLUDE_DIRS} ${TARGET_CMSIS_COMMON_INCLUDE_DIRS} ${TARGET_CHIBIOS_COMMON_INCLUDE_DIRS} diff --git a/targets/CMSIS-OS/ChibiOS/ST_STM32F769I_DISCOVERY/CMakeLists.txt b/targets/CMSIS-OS/ChibiOS/ST_STM32F769I_DISCOVERY/CMakeLists.txt index d51dd5ad3e..4fcdc14448 100644 --- a/targets/CMSIS-OS/ChibiOS/ST_STM32F769I_DISCOVERY/CMakeLists.txt +++ b/targets/CMSIS-OS/ChibiOS/ST_STM32F769I_DISCOVERY/CMakeLists.txt @@ -169,8 +169,8 @@ include_directories( ${WireProtocol_INCLUDE_DIRS} ${CHIBIOS_INCLUDE_DIRS} - ${CHIBIOS_CONTRIB_INCLUDE_DIRS} ${ChibiOSnfOverlay_INCLUDE_DIRS} + ${CHIBIOS_CONTRIB_INCLUDE_DIRS} ${TARGET_CMSIS_COMMON_INCLUDE_DIRS} ${TARGET_CHIBIOS_COMMON_INCLUDE_DIRS}