File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -10,19 +10,19 @@ if [ ! -f "$BUILD_PATH/sketch" ]; then
1010fi
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)
1316if [ ! -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"
1518else
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"
2024fi
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
2828echo " #include <SrcWrapper.h>" > " $BUILD_PATH /sketch/SrcWrapper.cpp"
You can’t perform that action at this time.
0 commit comments