forked from ARMmbed/mbed-os
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure WICED is included for Mbed targets that require it. This also removes the need for checking MBED_TARGET_LABELS repeatedly and allows us to be more flexible in the way we include MBED_TARGET source in the build. A side effect of this is it will allow us to support custom targets without breaking the build for 'standard' targets, as we use CMake's standard mechanism for adding build rules to the build system, rather than implementing our own layer of logic to exclude files not needed for the target being built. Using this approach, if an MBED_TARGET is not linked to using `target_link_libraries` its source files will not be added to the build. This means custom target source can be added to the user's application CMakeLists.txt without polluting the build system when trying to compile for a standard MBED_TARGET.
- Loading branch information
1 parent
3174a4c
commit d7a7d44
Showing
3 changed files
with
19 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F412xG/TARGET_WIO_EMW3166/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
# Copyright (c) 2020 ARM Limited. All rights reserved. | ||
# Copyright (c) 2020-2021 ARM Limited. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
add_library(WIO_EMW3166 INTERFACE) | ||
add_library(mbed-wio-emw3166 INTERFACE) | ||
|
||
target_sources(WIO_EMW3166 | ||
target_sources(mbed-wio-emw3166 | ||
INTERFACE | ||
PeripheralPins.c | ||
) | ||
|
||
target_include_directories(WIO_EMW3166 | ||
target_include_directories(mbed-wio-emw3166 | ||
INTERFACE | ||
. | ||
) | ||
|
||
target_link_libraries(WIO_EMW3166 INTERFACE STM32F412xG) | ||
target_link_libraries(mbed-wio-emw3166 INTERFACE mbed-wiced mbed-stm32f412xg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
# Copyright (c) 2020 ARM Limited. All rights reserved. | ||
# Copyright (c) 2020-2021 ARM Limited. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if("WIO_EMW3166" IN_LIST MBED_TARGET_LABELS) | ||
if(${MBED_TOOLCHAIN} STREQUAL "ARM") | ||
set(LIB_WICED_DRIVERS TOOLCHAIN_ARMC6/TARGET_WIO_EMW3166/libwiced_drivers.ar) | ||
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") | ||
set(LIB_WICED_DRIVERS TOOLCHAIN_GCC_ARM/TARGET_WIO_EMW3166/libwiced_drivers.a) | ||
endif() | ||
add_library(mbed-wiced INTERFACE) | ||
|
||
if(${MBED_TOOLCHAIN} STREQUAL "ARM") | ||
set(LIB_WICED_DRIVERS TOOLCHAIN_ARMC6/TARGET_WIO_EMW3166/libwiced_drivers.ar) | ||
elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM") | ||
set(LIB_WICED_DRIVERS TOOLCHAIN_GCC_ARM/TARGET_WIO_EMW3166/libwiced_drivers.a) | ||
endif() | ||
|
||
target_link_libraries(mbed-core INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/${LIB_WICED_DRIVERS}) | ||
target_link_libraries(mbed-wiced INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/${LIB_WICED_DRIVERS}) | ||
|
||
target_include_directories(mbed-core | ||
target_include_directories(mbed-wiced | ||
INTERFACE | ||
wiced_interface | ||
) | ||
|
||
target_sources(mbed-core | ||
target_sources(mbed-wiced | ||
INTERFACE | ||
wiced_interface/default_wifi_interface.cpp | ||
) |