Skip to content
This repository was archived by the owner on Nov 19, 2022. It is now read-only.

Commit 1c6d74c

Browse files
committed
Save and restore symbolic links under build dir
1 parent 3478802 commit 1c6d74c

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

platform.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ recipe.hooks.core.prebuild.1.pattern={intiki.cmd-v} -recipe stage -stage core {m
7575
recipe.hooks.linking.prelink.1.pattern={intiki.cmd-v} -recipe stage -stage link {make.paths}
7676
recipe.hooks.objcopy.preobjcopy.1.pattern={intiki.cmd-v} -recipe makefile {make.paths} -template {build.system.path}/support/CMakeLists.txt.template -makefile {build.path}/_cmakefile/CMakeLists.txt
7777
recipe.hooks.objcopy.preobjcopy.2.pattern={intiki.cmd-v} -recipe make {make.paths} -make.command {build.make.command} -- {make.args} -P {build.system.path}/support/build.cmake
78+
recipe.hooks.postbuild.1.pattern={intiki.cmd-v} -recipe make {make.paths} -make.command {build.make.command} -- {make.args} -P {build.system.path}/support/postbuild.cmake
7879

7980

8081
tools.west.upload.cmd.windows={runtime.platform.path}/system/support/west_wrap.bat

system/support/build.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ set(build_dir ${ARDUINO_BUILD_PATH})
44

55
file(COPY ${ARDUINO_VARIANT_PATH}/prj.conf DESTINATION ${ARDUINO_BUILD_PATH}/_cmakefile )
66

7+
if(EXISTS ${build_dir}/zephyr/ )
8+
execute_process(
9+
COMMAND python3 $ENV{ZEPHYR_BASE}/scripts/subfolder_list.py
10+
--directory $ENV{ZEPHYR_BASE}/include
11+
--out-file ${build_dir}/zephyr/misc/generated/syscalls_subdirs.txt
12+
--trigger ${build_dir}/zephyr/misc/generated/syscalls_subdirs.trigger
13+
--create-links ${build_dir}/zephyr/misc/generated/syscalls_links
14+
)
15+
endif()
16+
717
if(EXISTS ${ARDUINO_BUILD_PATH}/_cmakefile/.NOT_CHANGED )
818
file(REMOVE ${ARDUINO_BUILD_PATH}/_cmakefile/.NOT_CHANGED )
919
else()

system/support/postbuild.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
cmake_minimum_required(VERSION 3.0.2)
2+
3+
file(GLOB_RECURSE files ${ARDUINO_BUILD_PATH}/preproc/zephyr/misc/generatec/syscalls_links/* ${ARDUINO_BUILD_PATH}/zephyr/misc/generatec/syscalls_links/*)
4+
5+
foreach(f ${files})
6+
if(IS_SYMLINK ${f})
7+
file(REMOVE ${f})
8+
endif()
9+
endforeach()

system/support/preproc.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ set(preproc_dir ${ARDUINO_BUILD_PATH}/preproc)
44

55
file(COPY ${ARDUINO_VARIANT_PATH}/prj.conf DESTINATION ${ARDUINO_BUILD_PATH}/preproc/_cmakefile )
66

7+
if(EXISTS ${preproc_dir}/zephyr/ )
8+
execute_process(
9+
COMMAND python3 $ENV{ZEPHYR_BASE}/scripts/subfolder_list.py
10+
--directory $ENV{ZEPHYR_BASE}/include
11+
--out-file ${preproc_dir}/zephyr/misc/generated/syscalls_subdirs.txt
12+
--trigger ${preproc_dir}/zephyr/misc/generated/syscalls_subdirs.trigger
13+
--create-links ${preproc_dir}/zephyr/misc/generated/syscalls_links
14+
)
15+
endif()
16+
717
if(EXISTS ${ARDUINO_BUILD_PATH}/preproc/_cmakefile/.NOT_CHANGED )
818
file(REMOVE ${ARDUINO_BUILD_PATH}/preproc/_cmakefile/.NOT_CHANGED )
919
else()

0 commit comments

Comments
 (0)