Skip to content

Commit

Permalink
Add cc13x2_26x2 build to unified build (project-chip#4572)
Browse files Browse the repository at this point in the history
* Add cc13x2_26x2 build to unified build

There are some missing files in build_overrides to build TI in the
unified build, as well as some missing dependencies diagnosed by
gn --check --fail-on-unused-args.

Fix those issues so that cc13x2_26x2 can be built together with the
other examples. Also despam the sysconfig generator so we don't
drown out important diagnostics.

Tested via

  ./gn_build.sh enable_cc13x2_26x2_builds=true ti_simplelink_sdk_root=\"$HOME/ti/simplelink_cc13x2_26x2_sdk_4_40_00_44\" ti_sysconfig_root=\"$HOME/ti/sysconfig_1.7.0\"

* Use braces in substitution

Co-authored-by: Justin Wood <[email protected]>
  • Loading branch information
2 people authored and austinh0 committed Feb 3, 2021
1 parent adbfbde commit bf68c65
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 3 deletions.
18 changes: 18 additions & 0 deletions build_overrides/freertos.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2020 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

declare_args() {
# Root directory for FreeRTOS
freertos_root = "//third_party/freertos"
}
18 changes: 18 additions & 0 deletions build_overrides/ti_simplelink_sdk.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2020 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

declare_args() {
# Root directory for TI SimpleLink SDK build helpers.
ti_simplelink_sdk_build_root = "//third_party/ti_simplelink_sdk"
}
25 changes: 25 additions & 0 deletions config/cc13x2_26x2/toolchain/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2020 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")

import("${build_root}/toolchain/arm_gcc/arm_toolchain.gni")

arm_toolchain("cc13x2_26x2_lock_app") {
toolchain_args = {
current_os = "freertos"
import("${chip_root}/examples/lock-app/cc13x2_26x2/args.gni")
}
}
2 changes: 0 additions & 2 deletions src/platform/cc13x2_26x2/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ arm_platform_config =

chip_device_platform = "cc13x2_26x2"

freertos_target = "${chip_root}/third_party/ti_simplelink_sdk:freertos"

mbedtls_target = "${chip_root}/third_party/ti_simplelink_sdk:mbedtls"
openthread_external_mbedtls = mbedtls_target
openthread_external_platform =
Expand Down
6 changes: 5 additions & 1 deletion third_party/ti_simplelink_sdk/ti_simplelink_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ import("//build_overrides/build.gni")
import("//build_overrides/chip.gni")
import("//build_overrides/freertos.gni")
import("//build_overrides/mbedtls.gni")
import("//build_overrides/openthread.gni")
import("//build_overrides/pigweed.gni")
import("//build_overrides/ti_simplelink_sdk.gni")

import("${dir_pw_build}/python.gni")
import("${freertos_root}/freertos.gni")
import("${mbedtls_root}/mbedtls.gni")
import("ti_simplelink_board.gni")
Expand Down Expand Up @@ -63,7 +66,7 @@ template("ti_sysconfig") {
}
}

action("${target_name}_gen") {
pw_python_action("${target_name}_gen") {
script = "${ti_simplelink_sdk_build_root}/run_sysconfig.py"
sources = invoker.sources
outputs = gen_outputs
Expand Down Expand Up @@ -227,6 +230,7 @@ template("ti_simplelink_sdk") {
"${chip_root}/third_party/ti_simplelink_sdk:freertos",
"${chip_root}/third_party/ti_simplelink_sdk:mbedtls",
"${chip_root}/third_party/ti_simplelink_sdk:ti_simplelink_sysconfig",
"${openthread_root}/src/core:libopenthread_core_headers",
]

configs -= [ "${build_root}/config/compiler:std_default" ]
Expand Down

0 comments on commit bf68c65

Please sign in to comment.