[cmake] no target_link_options in cmake 3.10 (#5706)

This commit is contained in:
Yakun Xu
2020-10-27 09:00:02 -07:00
committed by GitHub
parent 3fd161e4d4
commit d1981e04ae
11 changed files with 42 additions and 53 deletions
+2 -6
View File
@@ -74,17 +74,13 @@ set_target_properties(
target_link_libraries(openthread-cc1352
PUBLIC
cc13x2-cc26x2-driver
-Wl,--gc-sections
-Wl,-Map=$<TARGET_PROPERTY:NAME>.map
PRIVATE
${OT_MBEDTLS}
ot-config
)
target_link_options(openthread-cc1352
PUBLIC
-Wl,--gc-sections
-Wl,-Map=$<TARGET_PROPERTY:NAME>.map
)
target_compile_definitions(openthread-cc1352
PUBLIC
${OT_PLATFORM_DEFINES}
+7 -3
View File
@@ -62,9 +62,13 @@ set_target_properties(
CXX_STANDARD 11
)
target_link_libraries(openthread-cc2538 PRIVATE openthread-platform-utils ot-config)
target_link_options(openthread-cc2538 PUBLIC -T${PROJECT_SOURCE_DIR}/examples/platforms/cc2538/cc2538.ld)
target_link_options(openthread-cc2538 PUBLIC -Wl,--gc-sections -Wl,-Map=$<TARGET_PROPERTY:NAME>.map)
target_link_libraries(openthread-cc2538
PRIVATE
ot-config
PUBLIC
-T${PROJECT_SOURCE_DIR}/examples/platforms/cc2538/cc2538.ld
-Wl,--gc-sections -Wl,-Map=$<TARGET_PROPERTY:NAME>.map
)
target_compile_definitions(openthread-cc2538
PUBLIC
+3 -8
View File
@@ -74,16 +74,11 @@ set_target_properties(
target_link_libraries(openthread-cc2650
PUBLIC
cc26x0-driver
PRIVATE
${OT_MBEDTLS}
openthread-platform-utils
ot-config
)
target_link_options(openthread-cc2650
PUBLIC
-Wl,--gc-sections
-Wl,-Map=$<TARGET_PROPERTY:NAME>.map
PRIVATE
${OT_MBEDTLS}
ot-config
)
target_compile_definitions(openthread-cc2650
+1 -5
View File
@@ -74,16 +74,12 @@ set_target_properties(
target_link_libraries(openthread-cc2652
PUBLIC
cc13x2-cc26x2-driver
-Wl,--gc-sections
PRIVATE
${OT_MBEDTLS}
ot-config
)
target_link_options(openthread-cc2652
PUBLIC
-Wl,--gc-sections
)
target_compile_definitions(openthread-cc2652
PUBLIC
${OT_PLATFORM_DEFINES}
+8 -3
View File
@@ -59,9 +59,14 @@ set_target_properties(
CXX_STANDARD 11
)
target_link_libraries(openthread-kw41z PRIVATE nxp-kw41z-driver ot-config)
target_link_options(openthread-kw41z PRIVATE -T${PROJECT_SOURCE_DIR}/examples/platforms/kw41z/MKW41Z512xxx4.ld)
target_link_options(openthread-kw41z PRIVATE -Wl,--gc-sections -Wl,-Map=$<TARGET_PROPERTY:NAME>.map)
target_link_libraries(openthread-kw41z
PRIVATE
nxp-kw41z-driver
ot-config
PUBLIC
-T${PROJECT_SOURCE_DIR}/examples/platforms/kw41z/MKW41Z512xxx4.ld
-Wl,--gc-sections -Wl,-Map=$<TARGET_PROPERTY:NAME>.map
)
target_compile_definitions(openthread-kw41z
PUBLIC
@@ -79,9 +79,6 @@ target_link_libraries(openthread-qpg6095
qpg6095-driver
${OT_MBEDTLS}
ot-config
)
target_link_options(openthread-qpg6095
PUBLIC
-T${CMAKE_CURRENT_SOURCE_DIR}/qpg6095.ld
-Wl,--gc-sections
+2 -6
View File
@@ -74,17 +74,13 @@ endif()
target_link_libraries(openthread-samr21
PUBLIC
samr21-driver
-Wl,--gc-sections
-Wl,-Map=$<TARGET_PROPERTY:NAME>.map
PRIVATE
${OT_MBEDTLS}
ot-config
)
target_link_options(openthread-samr21
PUBLIC
-Wl,--gc-sections
-Wl,-Map=$<TARGET_PROPERTY:NAME>.map
)
target_compile_definitions(openthread-samr21
PUBLIC
${OT_PLATFORM_DEFINES}
+15 -7
View File
@@ -98,13 +98,21 @@ build_samr21()
main()
{
build_cc1352
build_cc2538
build_cc2650
build_cc2652
build_kw41z
build_qpg6095
build_samr21
if [[ $# == 0 ]]; then
build_cc1352
build_cc2538
build_cc2650
build_cc2652
build_kw41z
build_qpg6095
build_samr21
return 0
fi
while [[ $# != 0 ]]; do
"build_$1"
shift
done
}
main "$@"
+1 -1
View File
@@ -154,7 +154,7 @@ main()
OT_CMAKE_NINJA_TARGET=("ot-cli-mtd" "ot-ncp-mtd")
options+=("-DCMAKE_TOOLCHAIN_FILE=examples/platforms/${platform}/arm-none-eabi.cmake" "-DCMAKE_BUILD_TYPE=MinSizeRel")
;;
cc1352 | cc2538 | cc2652 | qpg6095 | samr21)
cc1352 | cc2538 | cc2652 | kw41z | qpg6095 | samr21)
options+=("-DCMAKE_TOOLCHAIN_FILE=examples/platforms/${platform}/arm-none-eabi.cmake" "-DCMAKE_BUILD_TYPE=MinSizeRel")
;;
*)
+3 -3
View File
@@ -55,13 +55,13 @@ if(OT_CFLAGS MATCHES "-pedantic-errors")
string(REPLACE "-pedantic-errors" "" OT_CFLAGS "${OT_CFLAGS}")
endif()
target_link_options(samr21-driver
target_link_libraries(samr21-driver
PUBLIC
-T${PROJECT_SOURCE_DIR}/third_party/microchip/include/samr21x18a.ld
PRIVATE
ot-config
)
target_link_libraries(samr21-driver PRIVATE ot-config)
target_compile_definitions(samr21-driver
PUBLIC
${OT_PLATFORM_DEFINES}
-8
View File
@@ -32,10 +32,6 @@ if(OT_PLATFORM STREQUAL "cc2650")
target_link_libraries(cc26x0-driver
INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/devices/cc26x0/driverlib/bin/gcc/driverlib.a
)
target_link_options(cc26x0-driver
INTERFACE
-T${CMAKE_CURRENT_SOURCE_DIR}/devices/cc26x0/linker_files/cc26x0f128.lds
)
elseif(OT_PLATFORM STREQUAL "cc1352" OR OT_PLATFORM STREQUAL "cc2652")
@@ -44,10 +40,6 @@ elseif(OT_PLATFORM STREQUAL "cc1352" OR OT_PLATFORM STREQUAL "cc2652")
target_link_libraries(cc13x2-cc26x2-driver
INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/devices/cc13x2_cc26x2/driverlib/bin/gcc/driverlib.a
)
target_link_options(cc13x2-cc26x2-driver
INTERFACE
-T${CMAKE_CURRENT_SOURCE_DIR}/devices/cc13x2_cc26x2/linker_files/cc26x2r1f.lds
)
endif()