diff --git a/CMakeLists.txt b/CMakeLists.txt index be0c0fa5c3d..6fbd2f38dd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,8 +35,6 @@ endif() # For Zephyr more specifically this breaks (at least) # -fmacro-prefix-map=${ZEPHYR_BASE}= -project(Zephyr-Kernel VERSION ${PROJECT_VERSION}) -enable_language(C CXX ASM) # Verify that the toolchain can compile a dummy file, if it is not we # won't be able to test for compatibility with certain C flags. diff --git a/cmake/app/boilerplate.cmake b/cmake/app/boilerplate.cmake index e044e9be61c..b4fbc1182f1 100644 --- a/cmake/app/boilerplate.cmake +++ b/cmake/app/boilerplate.cmake @@ -470,6 +470,15 @@ endif() include(${ZEPHYR_BASE}/cmake/target_toolchain.cmake) +project(Zephyr-Kernel VERSION ${PROJECT_VERSION}) +enable_language(C CXX ASM) + +# 'project' sets PROJECT_BINARY_DIR to ${CMAKE_CURRENT_BINARY_DIR}, +# but for legacy reasons we need it to be set to +# ${CMAKE_CURRENT_BINARY_DIR}/zephyr +set(PROJECT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/zephyr) +set(PROJECT_SOURCE_DIR ${ZEPHYR_BASE}) + set(KERNEL_NAME ${CONFIG_KERNEL_BIN_NAME}) set(KERNEL_ELF_NAME ${KERNEL_NAME}.elf)