Skip to content

CMake: Refactor Cypress targets #14289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@ function(mbed_generate_bin_hex target)
VERBATIM
)

if(TARGET mbed-post-build-bin)
if(TARGET mbed-post-build-bin-${MBED_TARGET})
add_custom_target(mbed-post-build
ALL
DEPENDS
mbed-post-build-bin
mbed-post-build-bin-${MBED_TARGET}
)
endif()
endfunction()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ target_include_directories(mbed-emac

target_sources(mbed-emac
INTERFACE
interface/SclSTAInterface.cpp
interface/default_wifi_interface.cpp
interface/scl_emac.cpp
interface/SclAccessPoint.cpp
interface/SclSTAInterface.cpp
)
15 changes: 11 additions & 4 deletions targets/TARGET_Cypress/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if("PSOC6" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_PSOC6)
endif()
add_subdirectory(TARGET_PSOC6 EXCLUDE_FROM_ALL)

add_library(mbed-cy-external-wifi-fw INTERFACE)
target_compile_definitions(mbed-cy-external-wifi-fw
INTERFACE
"CY_ENABLE_XIP_PROGRAM"
"CY_STORAGE_WIFI_DATA=\".cy_xip\""
"CY_STORAGE_WIFI_DATA_OUTPUT=cy_xip"
"CY_EXT_WIFI_FW_STORAGE=QSPIF"
)
180 changes: 82 additions & 98 deletions targets/TARGET_Cypress/TARGET_PSOC6/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,115 +1,94 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if("SCL" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(COMPONENT_SCL EXCLUDE_FROM_ALL)
endif()
add_subdirectory(COMPONENT_SCL EXCLUDE_FROM_ALL)
add_subdirectory(COMPONENT_WHD EXCLUDE_FROM_ALL)
add_subdirectory(common/COMPONENT_WHD EXCLUDE_FROM_ALL)

if("WHD" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(COMPONENT_WHD EXCLUDE_FROM_ALL)
add_subdirectory(common/COMPONENT_WHD EXCLUDE_FROM_ALL)
endif()
add_library(mbed-cat1a INTERFACE)

if("CAT1A" IN_LIST MBED_TARGET_LABELS)
target_include_directories(mbed-core
INTERFACE
psoc6pdl/devices/COMPONENT_CAT1A/include
psoc6pdl/devices/COMPONENT_CAT1A/include/ip
)
endif()
target_include_directories(mbed-cat1a
INTERFACE
psoc6pdl/devices/COMPONENT_CAT1A/include
psoc6pdl/devices/COMPONENT_CAT1A/include/ip
)

if("CY8CKIT064B0S2_4343W" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_CY8CKIT064B0S2_4343W)
elseif("CY8CKIT_062S2_43012" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_CY8CKIT_062S2_43012)
elseif("CY8CKIT_062_BLE" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_CY8CKIT_062_BLE)
elseif("CY8CKIT_062_WIFI_BT" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_CY8CKIT_062_WIFI_BT)
elseif("CY8CPROTO_062S3_4343W" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_CY8CPROTO_062S3_4343W)
elseif("CY8CPROTO_062_4343W" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_CY8CPROTO_062_4343W)
elseif("CYSBSYSKIT_01" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_CYSBSYSKIT_01)
elseif("CYTFM_064B0S2_4343W" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_CYTFM_064B0S2_4343W)
elseif("CYW9P62S1_43012EVB_01" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_CYW9P62S1_43012EVB_01)
elseif("CYW9P62S1_43438EVB_01" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_CYW9P62S1_43438EVB_01)
endif()
add_subdirectory(TARGET_CY8CKIT064B0S2_4343W EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_CY8CKIT_062S2_43012 EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_CY8CKIT_062_BLE EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_CY8CKIT_062_WIFI_BT EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_CY8CPROTO_062S3_4343W EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_CY8CPROTO_062_4343W EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_CYSBSYSKIT_01 EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_CYTFM_064B0S2_4343W EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_CYW9P62S1_43012EVB_01 EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_CYW9P62S1_43438EVB_01 EXCLUDE_FROM_ALL)

add_subdirectory(psoc6csp/abstraction/rtos EXCLUDE_FROM_ALL)

if("CM0P_BLESS" IN_LIST MBED_TARGET_LABELS)
target_sources(mbed-core
INTERFACE
psoc6cm0p/COMPONENT_CM0P_BLESS/psoc6_cm0p_bless.c
)
endif()

if("CM0P_CRYPTO" IN_LIST MBED_TARGET_LABELS)
target_sources(mbed-core
INTERFACE
psoc6cm0p/COMPONENT_CM0P_CRYPTO/psoc6_01_cm0p_crypto.c
psoc6cm0p/COMPONENT_CM0P_CRYPTO/psoc6_02_cm0p_crypto.c
psoc6cm0p/COMPONENT_CM0P_CRYPTO/psoc6_03_cm0p_crypto.c
psoc6cm0p/COMPONENT_CM0P_CRYPTO/psoc6_04_cm0p_crypto.c
)
endif()
add_library(mbed-cm0p-bless INTERFACE)
target_sources(mbed-cm0p-bless
INTERFACE
psoc6cm0p/COMPONENT_CM0P_BLESS/psoc6_cm0p_bless.c
)

if("CM0P_SECURE" IN_LIST MBED_TARGET_LABELS)
target_sources(mbed-core
INTERFACE
psoc6cm0p/COMPONENT_CM0P_SECURE/psoc6_02_cm0p_secure.c
psoc6cm0p/COMPONENT_CM0P_SECURE/psoc6_03_cm0p_secure.c
)
endif()
add_library(mbed-cm0p-crypto INTERFACE)
target_sources(mbed-cm0p-crypto
INTERFACE
psoc6cm0p/COMPONENT_CM0P_CRYPTO/psoc6_01_cm0p_crypto.c
psoc6cm0p/COMPONENT_CM0P_CRYPTO/psoc6_02_cm0p_crypto.c
psoc6cm0p/COMPONENT_CM0P_CRYPTO/psoc6_03_cm0p_crypto.c
psoc6cm0p/COMPONENT_CM0P_CRYPTO/psoc6_04_cm0p_crypto.c
)

if("CM0P_SLEEP" IN_LIST MBED_TARGET_LABELS)
target_sources(mbed-core
INTERFACE
psoc6cm0p/COMPONENT_CM0P_SLEEP/psoc6_01_cm0p_sleep.c
psoc6cm0p/COMPONENT_CM0P_SLEEP/psoc6_02_cm0p_sleep.c
psoc6cm0p/COMPONENT_CM0P_SLEEP/psoc6_03_cm0p_sleep.c
psoc6cm0p/COMPONENT_CM0P_SLEEP/psoc6_04_cm0p_sleep.c
)
endif()
add_library(mbed-cm0p-secure INTERFACE)
target_sources(mbed-cm0p-secure
INTERFACE
psoc6cm0p/COMPONENT_CM0P_SECURE/psoc6_02_cm0p_secure.c
psoc6cm0p/COMPONENT_CM0P_SECURE/psoc6_03_cm0p_secure.c
)

if("UDB_SDIO_P12" IN_LIST MBED_TARGET_LABELS)
target_include_directories(mbed-core
INTERFACE
common/udb-sdio-whd/COMPONENT_UDB_SDIO_P12
)
add_library(mbed-cm0p-sleep INTERFACE)
target_sources(mbed-cm0p-sleep
INTERFACE
psoc6cm0p/COMPONENT_CM0P_SLEEP/psoc6_01_cm0p_sleep.c
psoc6cm0p/COMPONENT_CM0P_SLEEP/psoc6_02_cm0p_sleep.c
psoc6cm0p/COMPONENT_CM0P_SLEEP/psoc6_03_cm0p_sleep.c
psoc6cm0p/COMPONENT_CM0P_SLEEP/psoc6_04_cm0p_sleep.c
)

target_sources(mbed-core
INTERFACE
common/udb-sdio-whd/COMPONENT_UDB_SDIO_P12/SDIO_HOST_cfg.c
)
elseif("UDB_SDIO_P2" IN_LIST MBED_TARGET_LABELS)
target_include_directories(mbed-core
INTERFACE
common/udb-sdio-whd/COMPONENT_UDB_SDIO_P2
)
add_library(mbed-udb-sdio-p12 INTERFACE)
target_include_directories(mbed-udb-sdio-p12
INTERFACE
common/udb-sdio-whd/COMPONENT_UDB_SDIO_P12
)
target_sources(mbed-udb-sdio-p12
INTERFACE
common/udb-sdio-whd/COMPONENT_UDB_SDIO_P12/SDIO_HOST_cfg.c
)

target_sources(mbed-core
INTERFACE
common/udb-sdio-whd/COMPONENT_UDB_SDIO_P2/SDIO_HOST_cfg.c
)
elseif("UDB_SDIO_P9" IN_LIST MBED_TARGET_LABELS)
target_include_directories(mbed-core
INTERFACE
common/udb-sdio-whd/COMPONENT_UDB_SDIO_P9
)
add_library(mbed-udb-sdio-p2 INTERFACE)
target_include_directories(mbed-udb-sdio-p2
INTERFACE
common/udb-sdio-whd/COMPONENT_UDB_SDIO_P2
)
target_sources(mbed-udb-sdio-p2
INTERFACE
common/udb-sdio-whd/COMPONENT_UDB_SDIO_P2/SDIO_HOST_cfg.c
)

target_sources(mbed-core
INTERFACE
common/udb-sdio-whd/COMPONENT_UDB_SDIO_P9/SDIO_HOST_cfg.c
)
endif()
add_library(mbed-udb-sdio-p9 INTERFACE)
target_include_directories(mbed-udb-sdio-p9
INTERFACE
common/udb-sdio-whd/COMPONENT_UDB_SDIO_P9
)
target_sources(mbed-udb-sdio-p9
INTERFACE
common/udb-sdio-whd/COMPONENT_UDB_SDIO_P9/SDIO_HOST_cfg.c
)

target_include_directories(mbed-core
add_library(mbed-psoc6 INTERFACE)
target_include_directories(mbed-psoc6
INTERFACE
.
common
Expand All @@ -130,7 +109,7 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(ASSEMBLY_ROUTINES psoc6pdl/drivers/source/TOOLCHAIN_GCC_ARM/cy_syslib_gcc.S)
endif()

target_sources(mbed-core
target_sources(mbed-psoc6
INTERFACE
cy_analogin_api.c
cy_analogout_api.c
Expand Down Expand Up @@ -300,3 +279,8 @@ target_sources(mbed-core

${ASSEMBLY_ROUTINES}
)

# TODO: Include only if mbed-baremetal is not used
if("CY_RTOS_AWARE" IN_LIST MBED_CONFIG_DEFINITIONS)
target_link_libraries(mbed-psoc6 INTERFACE mbed-cy-rtos mbed-cy-rtx)
endif()
12 changes: 6 additions & 6 deletions targets/TARGET_Cypress/TARGET_PSOC6/COMPONENT_SCL/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# 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(mbed-cy_psoc6_scl INTERFACE)
add_library(mbed-cy-psoc6-scl INTERFACE)

target_include_directories(mbed-cy_psoc6_scl
target_include_directories(mbed-cy-psoc6-scl
INTERFACE
.
inc
src/include
)

target_sources(mbed-cy_psoc6_scl
target_sources(mbed-cy-psoc6-scl
INTERFACE
scl_buffer_api.c
scl_wifi_api.c
src/scl_buffer_api.c
src/scl_wifi_api.c

src/IPC/scl_ipc.c
)
Loading