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>
This commit is contained in:
parent
d2291c4b12
commit
3ffdcf4fca
2 changed files with 5 additions and 0 deletions
|
@ -77,8 +77,12 @@ set(PROJECT_SOURCE_DIR $ENV{ZEPHYR_BASE})
|
||||||
# Convert path to use the '/' separator
|
# Convert path to use the '/' separator
|
||||||
string(REPLACE "\\" "/" PROJECT_SOURCE_DIR ${PROJECT_SOURCE_DIR})
|
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_BINARY_DIR ${PROJECT_BINARY_DIR})
|
||||||
set(ZEPHYR_BASE ${PROJECT_SOURCE_DIR})
|
set(ZEPHYR_BASE ${PROJECT_SOURCE_DIR})
|
||||||
|
set(ENV{ZEPHYR_BASE} ${ZEPHYR_BASE})
|
||||||
|
|
||||||
set(AUTOCONF_H ${__build_dir}/include/generated/autoconf.h)
|
set(AUTOCONF_H ${__build_dir}/include/generated/autoconf.h)
|
||||||
# Re-configure (Re-execute all CMakeLists.txt code) when autoconf.h changes
|
# Re-configure (Re-execute all CMakeLists.txt code) when autoconf.h changes
|
||||||
|
|
|
@ -63,6 +63,7 @@ foreach(kconfig_target
|
||||||
PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
|
PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
|
||||||
srctree=${ZEPHYR_BASE}
|
srctree=${ZEPHYR_BASE}
|
||||||
KERNELVERSION=${KERNELVERSION}
|
KERNELVERSION=${KERNELVERSION}
|
||||||
|
ZEPHYR_BASE=${ZEPHYR_BASE}
|
||||||
KCONFIG_CONFIG=${DOTCONFIG}
|
KCONFIG_CONFIG=${DOTCONFIG}
|
||||||
ARCH=$ENV{ARCH}
|
ARCH=$ENV{ARCH}
|
||||||
BOARD_DIR=$ENV{BOARD_DIR}
|
BOARD_DIR=$ENV{BOARD_DIR}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue