Merge pull request #14427 from hugueskamba/hk_cmake_object_lorawan_refactor

CMake: Convert mbed-lorawan CMake library target to OBJECT
feature-cmake-object-libraries
Martin Kojtal 2021-03-15 15:39:13 +01:00 committed by GitHub
commit fd32ed0049
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 74 additions and 23 deletions

View File

@ -2,7 +2,6 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
add_library(mbed-802.15.4-rf INTERFACE) add_library(mbed-802.15.4-rf INTERFACE)
add_library(mbed-lorawan INTERFACE)
add_library(mbed-wifi INTERFACE) add_library(mbed-wifi INTERFACE)
add_subdirectory(FEATURE_BLE EXCLUDE_FROM_ALL) add_subdirectory(FEATURE_BLE EXCLUDE_FROM_ALL)
add_subdirectory(cellular EXCLUDE_FROM_ALL) add_subdirectory(cellular EXCLUDE_FROM_ALL)

View File

@ -1,12 +1,24 @@
# Copyright (c) 2020 ARM Limited. All rights reserved. # Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
target_include_directories(mbed-lorawan add_library(mbed-lorawan-sx126x INTERFACE)
target_include_directories(mbed-lorawan-sx126x
INTERFACE INTERFACE
. .
) )
target_sources(mbed-lorawan target_sources(mbed-lorawan-sx126x
INTERFACE INTERFACE
SX126X_LoRaRadio.cpp SX126X_LoRaRadio.cpp
) )
target_link_libraries(mbed-lorawan
PRIVATE
mbed-lorawan-sx126x
)
target_include_directories(mbed-lorawan
PUBLIC
$<TARGET_PROPERTY:mbed-lorawan-sx126x,INTERFACE_INCLUDE_DIRECTORIES>
)

View File

@ -1,13 +1,25 @@
# Copyright (c) 2020 ARM Limited. All rights reserved. # Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
target_include_directories(mbed-lorawan add_library(mbed-lorawan-sx1272 INTERFACE)
target_include_directories(mbed-lorawan-sx1272
INTERFACE INTERFACE
. .
./registers ./registers
) )
target_sources(mbed-lorawan target_sources(mbed-lorawan-sx1272
INTERFACE INTERFACE
SX1272_LoRaRadio.cpp SX1272_LoRaRadio.cpp
) )
target_link_libraries(mbed-lorawan
PRIVATE
mbed-lorawan-sx1272
)
target_include_directories(mbed-lorawan
PUBLIC
$<TARGET_PROPERTY:mbed-lorawan-sx1272,INTERFACE_INCLUDE_DIRECTORIES>
)

View File

@ -1,13 +1,25 @@
# Copyright (c) 2020 ARM Limited. All rights reserved. # Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
target_include_directories(mbed-lorawan add_library(mbed-lorawan-sx1276 INTERFACE)
target_include_directories(mbed-lorawan-sx1276
INTERFACE INTERFACE
. .
./registers ./registers
) )
target_sources(mbed-lorawan target_sources(mbed-lorawan-sx1276
INTERFACE INTERFACE
SX1276_LoRaRadio.cpp SX1276_LoRaRadio.cpp
) )
target_link_libraries(mbed-lorawan
PRIVATE
mbed-lorawan-sx1276
)
target_include_directories(mbed-lorawan
PUBLIC
$<TARGET_PROPERTY:mbed-lorawan-sx1276,INTERFACE_INCLUDE_DIRECTORIES>
)

View File

@ -1,12 +1,24 @@
# Copyright (c) 2020 ARM Limited. All rights reserved. # Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
target_include_directories(mbed-lorawan add_library(mbed-lorawan-stm32wl INTERFACE)
target_include_directories(mbed-lorawan-stm32wl
INTERFACE INTERFACE
. .
) )
target_sources(mbed-lorawan target_sources(mbed-lorawan-stm32wl
INTERFACE INTERFACE
STM32WL_LoRaRadio.cpp STM32WL_LoRaRadio.cpp
) )
target_link_libraries(mbed-lorawan
PRIVATE
mbed-lorawan-stm32wl
)
target_include_directories(mbed-lorawan
PUBLIC
$<TARGET_PROPERTY:mbed-lorawan-stm32wl,INTERFACE_INCLUDE_DIRECTORIES>
)

View File

@ -1,11 +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 # SPDX-License-Identifier: Apache-2.0
add_library(mbed-lorawan OBJECT)
add_subdirectory(lorastack) add_subdirectory(lorastack)
add_subdirectory(system) add_subdirectory(system)
target_include_directories(mbed-lorawan target_include_directories(mbed-lorawan
INTERFACE PUBLIC
.. ..
. .
./include ./include
@ -13,18 +15,20 @@ target_include_directories(mbed-lorawan
) )
target_sources(mbed-lorawan target_sources(mbed-lorawan
INTERFACE PRIVATE
source/LoRaWANInterface.cpp source/LoRaWANInterface.cpp
source/LoRaWANStack.cpp source/LoRaWANStack.cpp
) )
target_compile_definitions(mbed-lorawan target_compile_definitions(mbed-lorawan
INTERFACE PUBLIC
MBED_CONF_LORAWAN_PRESENT=1 MBED_CONF_LORAWAN_PRESENT=1
) )
target_link_libraries(mbed-lorawan target_link_libraries(mbed-lorawan
INTERFACE PRIVATE
mbed-core
mbed-events mbed-events
PUBLIC
mbed-mbedtls mbed-mbedtls
) )

View File

@ -1,15 +1,15 @@
# Copyright (c) 2020 ARM Limited. All rights reserved. # Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
target_include_directories(mbed-lorawan target_include_directories(mbed-lorawan
INTERFACE PUBLIC
. .
./mac ./mac
./phy ./phy
) )
target_sources(mbed-lorawan target_sources(mbed-lorawan
INTERFACE PRIVATE
mac/LoRaMac.cpp mac/LoRaMac.cpp
mac/LoRaMacChannelPlan.cpp mac/LoRaMacChannelPlan.cpp
mac/LoRaMacCommand.cpp mac/LoRaMacCommand.cpp

View File

@ -2,11 +2,11 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
target_sources(mbed-lorawan target_sources(mbed-lorawan
INTERFACE PRIVATE
LoRaWANTimer.cpp LoRaWANTimer.cpp
) )
target_include_directories(mbed-lorawan target_include_directories(mbed-lorawan
INTERFACE PUBLIC
. .
) )