Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6162582

Browse files
committed
fix(build_opt): add double quotes to allow space in path
and avoid to append same line at each build.Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent7318ac0 commit6162582

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎system/extras/prebuild.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ if [ ! -f "$BUILD_PATH/sketch" ]; then
1010
fi
1111

1212
# Create empty build.opt if build_opt.h does not exists in the original sketch dir
13+
# Then add or append -fmacro-prefix-map option to change __FILE__ absolute path of
14+
# the board platform folder to a relative path by using '.'.
15+
# (i.e. the folder containing boards.txt)
1316
if [!-f"$BUILD_SOURCE_PATH/build_opt.h" ];then
14-
touch"$BUILD_PATH/sketch/build.opt"
17+
printf'-fmacro-prefix-map="%s"=.'"${BOARD_PLATFORM_PATH//\\/\\\\}">"$BUILD_PATH/sketch/build.opt"
1518
else
1619
# Else copy the build_opt.h as build.opt
1720
# Workaround to the header file preprocessing done by arduino-cli
1821
# See https://github.com/arduino/arduino-cli/issues/1338
1922
cp"$BUILD_SOURCE_PATH/build_opt.h""$BUILD_PATH/sketch/build.opt"
23+
printf'\n-fmacro-prefix-map="%s"=.'"${BOARD_PLATFORM_PATH//\\/\\\\}">>"$BUILD_PATH/sketch/build.opt"
2024
fi
2125

22-
# Append -fmacro-prefix-map option to change __FILE__ absolute path of the board
23-
# platform folder to a relative path by using '.'.
24-
# (i.e. the folder containing boards.txt)
25-
printf'\n-fmacro-prefix-map=%s=.'"${BOARD_PLATFORM_PATH//\\/\\\\}">>"$BUILD_PATH/sketch/build.opt"
2626

2727
# Force include of SrcWrapper library
2828
echo"#include <SrcWrapper.h>">"$BUILD_PATH/sketch/SrcWrapper.cpp"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp