Skip to content

Commit

Permalink
fix CMakeList.txt isntead of fixing the scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
lmpprk authored and andy31415 committed Jan 10, 2022
1 parent 6dbafc9 commit 82c892a
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 27 deletions.
2 changes: 1 addition & 1 deletion examples/lighting-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake)
# Load NCS/Zephyr build system
set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf)

if (EXISTS boards/${BOARD}.conf)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.conf)
list(APPEND CONF_FILE boards/${BOARD}.conf)
endif()

Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake)
# Load NCS/Zephyr build system
set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf)

if (EXISTS boards/${BOARD}.conf)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.conf)
list(APPEND CONF_FILE boards/${BOARD}.conf)
endif()

Expand Down
4 changes: 4 additions & 0 deletions examples/pigweed-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ endif()
list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/nrfconnect/chip-module)
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})

if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.conf)
list(APPEND CONF_FILE boards/${BOARD}.conf)
endif()

project(chip-nrf52840-pigweed-example)

include(${CHIP_ROOT}/config/nrfconnect/app/enable-gnu-std.cmake)
Expand Down
2 changes: 1 addition & 1 deletion examples/pump-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake)
# Load NCS/Zephyr build system
set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf)

if (EXISTS boards/${BOARD}.conf)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.conf)
list(APPEND CONF_FILE boards/${BOARD}.conf)
endif()

Expand Down
2 changes: 1 addition & 1 deletion examples/pump-controller-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ include(${CHIP_ROOT}/config/nrfconnect/app/check-nrfconnect-version.cmake)
# Load NCS/Zephyr build system
set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf)

if (EXISTS boards/${BOARD}.conf)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.conf)
list(APPEND CONF_FILE boards/${BOARD}.conf)
endif()

Expand Down
4 changes: 4 additions & 0 deletions examples/shell/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ set(CONF_FILE ${CHIP_ROOT}/config/nrfconnect/app/sample-defaults.conf prj.conf)
list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/nrfconnect/chip-module)
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})

if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.conf)
list(APPEND CONF_FILE boards/${BOARD}.conf)
endif()

project(chip-nrfconnect-shell-example)

include(${CHIP_ROOT}/config/nrfconnect/app/enable-gnu-std.cmake)
Expand Down
5 changes: 0 additions & 5 deletions scripts/build/builders/nrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,6 @@ def generate(self):
raise Exception('ZEPHYR_BASE validation failed')

overlays = []
project_root = os.path.join(os.path.dirname(__file__), "../../..")
if os.path.exists(os.path.join(
project_root, self.app.AppPath(), "nrfconnect/boards", self.board.GnArgName()+".conf")):
overlays.append("-DOVERLAY_CONFIG=boards/" +
self.board.GnArgName()+".conf")
if self.enable_rpcs:
overlays.append("-DOVERLAY_CONFIG=rpc.overlay")

Expand Down
24 changes: 12 additions & 12 deletions scripts/build/testdata/build_all_except_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -567,27 +567,27 @@ west build --cmake-only -d {out}/nrf-native-posix-64-tests -b native_posix_64 {r
# Generating nrf-nrf52840dk-light
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf52840dk-light -b nrf52840dk_nrf52840 {root}/examples/lighting-app/nrfconnect -- -DOVERLAY_CONFIG=boards/nrf52840dk_nrf52840.conf'
west build --cmake-only -d {out}/nrf-nrf52840dk-light -b nrf52840dk_nrf52840 {root}/examples/lighting-app/nrfconnect'

# Generating nrf-nrf52840dk-light-rpc
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf52840dk-light-rpc -b nrf52840dk_nrf52840 {root}/examples/lighting-app/nrfconnect -- -DOVERLAY_CONFIG=boards/nrf52840dk_nrf52840.conf -DOVERLAY_CONFIG=rpc.overlay'
west build --cmake-only -d {out}/nrf-nrf52840dk-light-rpc -b nrf52840dk_nrf52840 {root}/examples/lighting-app/nrfconnect -- -DOVERLAY_CONFIG=rpc.overlay'

# Generating nrf-nrf52840dk-lock
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf52840dk-lock -b nrf52840dk_nrf52840 {root}/examples/lock-app/nrfconnect -- -DOVERLAY_CONFIG=boards/nrf52840dk_nrf52840.conf'
west build --cmake-only -d {out}/nrf-nrf52840dk-lock -b nrf52840dk_nrf52840 {root}/examples/lock-app/nrfconnect'

# Generating nrf-nrf52840dk-pump
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf52840dk-pump -b nrf52840dk_nrf52840 {root}/examples/pump-app/nrfconnect -- -DOVERLAY_CONFIG=boards/nrf52840dk_nrf52840.conf'
west build --cmake-only -d {out}/nrf-nrf52840dk-pump -b nrf52840dk_nrf52840 {root}/examples/pump-app/nrfconnect'

# Generating nrf-nrf52840dk-pump-controller
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf52840dk-pump-controller -b nrf52840dk_nrf52840 {root}/examples/pump-controller-app/nrfconnect -- -DOVERLAY_CONFIG=boards/nrf52840dk_nrf52840.conf'
west build --cmake-only -d {out}/nrf-nrf52840dk-pump-controller -b nrf52840dk_nrf52840 {root}/examples/pump-controller-app/nrfconnect'

# Generating nrf-nrf52840dk-shell
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
Expand All @@ -597,37 +597,37 @@ west build --cmake-only -d {out}/nrf-nrf52840dk-shell -b nrf52840dk_nrf52840 {ro
# Generating nrf-nrf52840dongle-light
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf52840dongle-light -b nrf52840dongle_nrf52840 {root}/examples/lighting-app/nrfconnect -- -DOVERLAY_CONFIG=boards/nrf52840dongle_nrf52840.conf'
west build --cmake-only -d {out}/nrf-nrf52840dongle-light -b nrf52840dongle_nrf52840 {root}/examples/lighting-app/nrfconnect'

# Generating nrf-nrf5340dk-light
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf5340dk-light -b nrf5340dk_nrf5340_cpuapp {root}/examples/lighting-app/nrfconnect -- -DOVERLAY_CONFIG=boards/nrf5340dk_nrf5340_cpuapp.conf'
west build --cmake-only -d {out}/nrf-nrf5340dk-light -b nrf5340dk_nrf5340_cpuapp {root}/examples/lighting-app/nrfconnect'

# Generating nrf-nrf5340dk-light-rpc
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf5340dk-light-rpc -b nrf5340dk_nrf5340_cpuapp {root}/examples/lighting-app/nrfconnect -- -DOVERLAY_CONFIG=boards/nrf5340dk_nrf5340_cpuapp.conf -DOVERLAY_CONFIG=rpc.overlay'
west build --cmake-only -d {out}/nrf-nrf5340dk-light-rpc -b nrf5340dk_nrf5340_cpuapp {root}/examples/lighting-app/nrfconnect -- -DOVERLAY_CONFIG=rpc.overlay'

# Generating nrf-nrf5340dk-lock
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf5340dk-lock -b nrf5340dk_nrf5340_cpuapp {root}/examples/lock-app/nrfconnect -- -DOVERLAY_CONFIG=boards/nrf5340dk_nrf5340_cpuapp.conf'
west build --cmake-only -d {out}/nrf-nrf5340dk-lock -b nrf5340dk_nrf5340_cpuapp {root}/examples/lock-app/nrfconnect'

# Generating nrf-nrf5340dk-pump
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf5340dk-pump -b nrf5340dk_nrf5340_cpuapp {root}/examples/pump-app/nrfconnect -- -DOVERLAY_CONFIG=boards/nrf5340dk_nrf5340_cpuapp.conf'
west build --cmake-only -d {out}/nrf-nrf5340dk-pump -b nrf5340dk_nrf5340_cpuapp {root}/examples/pump-app/nrfconnect'

# Generating nrf-nrf5340dk-pump-controller
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf5340dk-pump-controller -b nrf5340dk_nrf5340_cpuapp {root}/examples/pump-controller-app/nrfconnect -- -DOVERLAY_CONFIG=boards/nrf5340dk_nrf5340_cpuapp.conf'
west build --cmake-only -d {out}/nrf-nrf5340dk-pump-controller -b nrf5340dk_nrf5340_cpuapp {root}/examples/pump-controller-app/nrfconnect'

# Generating nrf-nrf5340dk-shell
bash -c 'source "$ZEPHYR_BASE/zephyr-env.sh";
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR";
west build --cmake-only -d {out}/nrf-nrf5340dk-shell -b nrf5340dk_nrf5340_cpuapp {root}/examples/shell/nrfconnect -- -DOVERLAY_CONFIG=boards/nrf5340dk_nrf5340_cpuapp.conf'
west build --cmake-only -d {out}/nrf-nrf5340dk-shell -b nrf5340dk_nrf5340_cpuapp {root}/examples/shell/nrfconnect'

# Generating qpg-qpg6100-lock
gn gen --check --fail-on-unused-args --export-compile-commands --root={root}/examples/lock-app/qpg {out}/qpg-qpg6100-lock
Expand Down
7 changes: 1 addition & 6 deletions scripts/examples/nrfconnect_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,4 @@ source "../scripts/activate.sh"
export GNUARMEMB_TOOLCHAIN_PATH="$PW_PIGWEED_CIPD_INSTALL_DIR"
env

OVERLAY_CONF_FLAGS=()
if [[ -f "$APP/nrfconnect/boards/$BOARD.conf" ]]; then
OVERLAY_CONF_FLAGS+=(-DOVERLAY_CONFIG=boards/"$BOARD".conf)
fi

west build -b "$BOARD" -d "$APP/nrfconnect/build/$BOARD" "$APP/nrfconnect" -- "${OVERLAY_CONF_FLAGS[@]}" "$@"
west build -b "$BOARD" -d "$APP/nrfconnect/build/$BOARD" "$APP/nrfconnect" -- "$@"

0 comments on commit 82c892a

Please sign in to comment.