Skip to content
Permalink
Browse files

cmake: boilerplate: Fix ZEPHYR_BASE variable for windows

In windows an additional / is added when using zephyr-env.cmd
this causes a build error in some scenarios. It also creates
ugly file paths.

Signed-off-by: Sigvart Hovland <sigvart.hovland@nordicsemi.no>
  • Loading branch information...
sigvartmh authored and nashif committed Apr 12, 2019
1 parent d2291c4 commit 3ffdcf4fca418f8376f76bfec990cc533dce54db
Showing with 5 additions and 0 deletions.
  1. +4 −0 cmake/app/boilerplate.cmake
  2. +1 −0 cmake/kconfig.cmake
@@ -77,8 +77,12 @@ set(PROJECT_SOURCE_DIR $ENV{ZEPHYR_BASE})
# Convert path to use the '/' separator
string(REPLACE "\\" "/" PROJECT_SOURCE_DIR ${PROJECT_SOURCE_DIR})

# Remove trailing '/', it results in ugly paths and also exposes some bugs
string(REGEX REPLACE "\/+$" "" PROJECT_SOURCE_DIR ${PROJECT_SOURCE_DIR})

set(ZEPHYR_BINARY_DIR ${PROJECT_BINARY_DIR})
set(ZEPHYR_BASE ${PROJECT_SOURCE_DIR})
set(ENV{ZEPHYR_BASE} ${ZEPHYR_BASE})

set(AUTOCONF_H ${__build_dir}/include/generated/autoconf.h)
# Re-configure (Re-execute all CMakeLists.txt code) when autoconf.h changes
@@ -63,6 +63,7 @@ foreach(kconfig_target
PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
srctree=${ZEPHYR_BASE}
KERNELVERSION=${KERNELVERSION}
ZEPHYR_BASE=${ZEPHYR_BASE}
KCONFIG_CONFIG=${DOTCONFIG}
ARCH=$ENV{ARCH}
BOARD_DIR=$ENV{BOARD_DIR}

0 comments on commit 3ffdcf4

Please sign in to comment.
You can’t perform that action at this time.