From bfef79d77ae0572f3732bb01fc27814988929c51 Mon Sep 17 00:00:00 2001 From: Seth Rickard Date: Wed, 25 Jan 2023 14:11:41 -0600 Subject: [PATCH] update build process to enable CI --- README.md | 1 + script/bootstrap | 7 +++---- script/build | 12 ++++++++++++ src/CMakeLists.txt | 4 +++- third_party/ti_simplelink_sdk/CMakeLists.txt | 4 +++- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d57f4cf..30f218e 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ In a Bash terminal, follow these instructions to install the GNU toolchain and o ```bash $ cd +$ git submodule update --init $ ./script/bootstrap ``` diff --git a/script/bootstrap b/script/bootstrap index d02b6f4..374daf4 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -29,15 +29,14 @@ set -euxo pipefail -SYSCONFIG=~/ti/sysconfig_1.14.0/ +SYSCONFIG_USER=~/ti/sysconfig_1.14.0/ +SYSCONFIG_SYSTEM=/opt/ti/sysconfig_1.14.0/ SYSCONFIG_DL=https://dr-download.ti.com/software-development/ide-configuration-compiler-or-debugger/MD-nsUM6f7Vvb/1.14.0.2667/sysconfig-1.14.0_2667-setup.run -if [ ! -d "$SYSCONFIG" ]; then +if [ ! -d "$SYSCONFIG_USER" ] && [ ! -d "$SYSCONFIG_SYSTEM"]; then wget "$SYSCONFIG_DL" -O /tmp/sysconfig-1.14.0_2667-setup.run chmod +x /tmp/sysconfig-1.14.0_2667-setup.run /tmp/sysconfig-1.14.0_2667-setup.run --mode unattended fi -git submodule update --init - "$(dirname "$0")"/../openthread/script/bootstrap diff --git a/script/build b/script/build index d80fb57..ed43595 100755 --- a/script/build +++ b/script/build @@ -30,6 +30,18 @@ set -euxo pipefail OT_CMAKE_NINJA_TARGET=${OT_CMAKE_NINJA_TARGET:-} +TI_SYSCONFIG_ROOT=${TI_SYSCONFIG_ROOT:-} + +SYSCONFIG_USER=~/ti/sysconfig_1.14.0/ +SYSCONFIG_SYSTEM=/opt/ti/sysconfig_1.14.0/ + +if [ -z "$TI_SYSCONFIG_ROOT" ]; then + if [ -d "$SYSCONFIG_USER" ]; then + TI_SYSCONFIG_ROOT="$SYSCONFIG_USER" + elif [ -d "$SYSCONFIG_SYSTEM" ]; then + TI_SYSCONFIG_ROOT="$SYSCONFIG_SYSTEM" + fi +fi readonly TI_LAUNCHPAD=( CC1352P1_LAUNCHXL diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 73beaed..ece90a0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -26,7 +26,9 @@ # POSSIBILITY OF SUCH DAMAGE. # -if(NOT DEFINED TI_SYSCONFIG_INSTALL_DIR) +if(NOT $ENV{TI_SYSCONFIG_ROOT} STREQUAL "") + set(TI_SYSCONFIG_INSTALL_DIR $ENV{TI_SYSCONFIG_ROOT} CACHE PATH "") +else() set(TI_SYSCONFIG_INSTALL_DIR $ENV{HOME}/ti/sysconfig_1.14.0 CACHE PATH "") endif() diff --git a/third_party/ti_simplelink_sdk/CMakeLists.txt b/third_party/ti_simplelink_sdk/CMakeLists.txt index 190b9de..d20950c 100644 --- a/third_party/ti_simplelink_sdk/CMakeLists.txt +++ b/third_party/ti_simplelink_sdk/CMakeLists.txt @@ -26,7 +26,9 @@ # POSSIBILITY OF SUCH DAMAGE. # -if(NOT DEFINED TI_SIMPLELINK_SDK_DIR) +if(NOT $ENV{TI_SIMPLELINK_SDK_DIR} STREQUAL "") + set(TI_SIMPLELINK_SDK_DIR $ENV{TI_SIMPLELINK_SDK_DIR} CACHE PATH "") +else() set(TI_SIMPLELINK_SDK_DIR ${PROJECT_SOURCE_DIR}/third_party/ti_simplelink_sdk/repo_cc13xx_cc26xx CACHE PATH "") endif()