Skip to content

Commit

Permalink
Fixed build functionality on non-linux platforms
Browse files Browse the repository at this point in the history
Removed dependency on linux platform for builds.

Signed-off-by: Jared Baumann <jared.baumann8@t-mobile.com>
  • Loading branch information
jtbaumann committed Feb 16, 2023
1 parent 8cec259 commit 166f661
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 19 deletions.
5 changes: 2 additions & 3 deletions samples/tmo_shell/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ project(tmo_shell)
zephyr_include_directories(${BOARD_DIR})

target_include_directories(app PRIVATE ${ZEPHYR_BASE}/subsys/ PRIVATE ${ZEPHYR_BASE}/drivers/modem/ PRIVATE ${ZEPHYR_BASE}/drivers/wifi/rs9116w)
FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE src/tmo_shell.c)
target_sources(app PRIVATE src/tmo_buzzer.c)
target_sources(app PRIVATE src/dfu_rs9116w.c)
Expand Down Expand Up @@ -92,14 +91,14 @@ if(DEFINED ENV{ZEPHYR_BASE_TAG})
add_compile_definitions(VERSION_ZEPHYR_BASE_TAG="$ENV{ZEPHYR_BASE_TAG}")
else()
execute_process(
COMMAND bash ${CMAKE_SOURCE_DIR}/get_zephyr_last_rebase_tag.sh
COMMAND git log --grep "Merge branch 'main' into tmo-main" --max-count 1 --pretty=%H
WORKING_DIRECTORY ${ZEPHYR_BASE}
OUTPUT_VARIABLE ZEPHYR_BASE_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if ("${ZEPHYR_BASE_TAG}" STREQUAL "")
execute_process(
COMMAND bash ${CMAKE_SOURCE_DIR}/get_zephyr_init_commit_tag.sh
COMMAND git log --grep "^Initial commit$" --max-count 1 --pretty=%H
WORKING_DIRECTORY ${ZEPHYR_BASE}
OUTPUT_VARIABLE ZEPHYR_BASE_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE
Expand Down
7 changes: 1 addition & 6 deletions samples/tmo_shell/boards/tmo_dev_edge.conf
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
# Copyright (c) 2022 T-Mobile USA, Inc.
# Copyright (c) 2022-2023 T-Mobile USA, Inc.
#
# SPDX-License-Identifier: Apache-2.0

CONFIG_BT_DEVICE_NAME="TMO DevEdge"
CONFIG_POSIX_CLOCK=y
CONFIG_CMU_HFCLK_HFXO=y
CONFIG_DEVICE_SHELL=y
CONFIG_GPIO_SHELL=y
CONFIG_SOC_GECKO_EMU_DCDC=y
CONFIG_SOC_GECKO_EMU_DCDC_MODE_OFF=y
CONFIG_I2C=y
CONFIG_SPI=y
CONFIG_REBOOT=y
CONFIG_COUNTER=y
CONFIG_LED=y
CONFIG_LED_PWM=y
CONFIG_LED_SHELL=y
CONFIG_PWM=y
CONFIG_PWM_SHELL=y
CONFIG_PWM_GECKO=y
CONFIG_SENSOR=y
CONFIG_SENSOR_SHELL=y
CONFIG_LPS22HH=y
Expand Down
2 changes: 1 addition & 1 deletion samples/tmo_shell/get_zephyr_init_commit_tag.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
git log | grep -A2 -m1 "Initial commit" | grep commit | awk NR==2'{print $2}'
git log --grep "^Initial commit$" --max-count 1 --pretty="format:%H"
2 changes: 1 addition & 1 deletion samples/tmo_shell/get_zephyr_last_rebase_tag.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
git log | grep -A2 -m1 "Merge branch 'main' into tmo-main" | grep commit | awk '{print $2}'
git log --grep "Merge branch 'main' into tmo-main" --max-count 1 --pretty="format:%H"
23 changes: 15 additions & 8 deletions set-zephyr-build-env
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
#!/bin/sh
#!/bin/bash

# adds any out of tree drivers built as modules to the zephyr build path
if [ "$SHELL" = "/bin/zsh" ]; then
BASH_SOURCE=${(%):-%x}
fi
LOCATION=$(dirname $(realpath -s $BASH_SOURCE))

export ZEPHYR_EXTRA_MODULES=$ZEPHYR_EXTRA_MODULES\;$LOCATION

if [ -n "$ZSH_VERSION" ]; then
SCRIPT=${(%):-%x}
elif [ -n "$BASH_VERSION" ]; then
SCRIPT=${BASH_SOURCE[0]}
elif eval '[[ -n ${.sh.file} ]]' 2>/dev/null; then
eval 'SCRIPT=${.sh.file}'
fi
LOCATION=$(dirname "$(readlink -f -- "$SCRIPT")")
if [ -n "${ZEPHYR_EXTRA_MODULES+1}" ]; then
export ZEPHYR_EXTRA_MODULES="$ZEPHYR_EXTRA_MODULES\;$LOCATION"
else
export ZEPHYR_EXTRA_MODULES="$LOCATION"
fi
#add lines as needed for each driver below

#export ZEPHYR_EXTRA_MODULES=$ZEPHYR_EXTRA_MODULES\;$LOCATION/drivers/(another driver here)

echo $ZEPHYR_EXTRA_MODULES
echo "$ZEPHYR_EXTRA_MODULES"
11 changes: 11 additions & 0 deletions set-zephyr-build-env.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@echo off

rem adds any out of tree drivers built as modules to the zephyr build path
set LOCATION=%~dp0
if "%ZEPHYR_EXTRA_MODULES%" == "" (
set ZEPHYR_EXTRA_MODULES=%LOCATION%
) else (
set ZEPHYR_EXTRA_MODULES=%ZEPHYR_EXTRA_MODULES%;%LOCATION%
)

echo %ZEPHYR_EXTRA_MODULES%
5 changes: 5 additions & 0 deletions set-zephyr-build-env.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if (!$env:ZEPHYR_EXTRA_MODULES) {
$env:ZEPHYR_EXTRA_MODULES = $PSScriptRoot
} else {
$env:ZEPHYR_EXTRA_MODULES += ';' + $PSScriptRoot
}

0 comments on commit 166f661

Please sign in to comment.