Skip to content

Commit 782e8c6

Browse files
committed
platform: use build.opt instead of build_opt.h
See: arduino/arduino-cli#1338 When the above issue will be fix. This change should be reviewed. This is backward compatible. Signed-off-by: Frederic Pillon <[email protected]>
1 parent 640eed4 commit 782e8c6

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Diff for: platform.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ build.flags.ldspecs=--specs=nano.specs
105105
build.flash_offset=0
106106

107107
# Pre and post build hooks
108-
build.opt.name=build_opt.h
108+
build.opt.name=build.opt
109109
build.opt.path={build.path}/sketch/{build.opt.name}
110110

111111
extras.path={build.system.path}/extras

Diff for: system/extras/prebuild.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ if [ ! -f "$BUILD_PATH/sketch" ]; then
88
mkdir -p "$BUILD_PATH/sketch"
99
fi
1010

11-
# Create empty build.opt.h if not exists in the original sketch dir
11+
# Create empty build.opt if build_opt.h does not exists in the original sketch dir
1212
if [ ! -f "$BUILD_SOURCE_PATH/build_opt.h" ]; then
13-
touch "$BUILD_PATH/sketch/build_opt.h"
13+
touch "$BUILD_PATH/sketch/build.opt"
14+
else
15+
# Else copy the build_opt.h as build.opt
16+
# Workaround to the header file preprocessing done by arduino-cli
17+
# See https://github.com/arduino/arduino-cli/issues/1338
18+
cp "$BUILD_SOURCE_PATH/build_opt.h" "$BUILD_PATH/sketch/build.opt"
1419
fi
1520

1621
# Force include of SrcWrapper library
17-
echo "#include <SrcWrapper.h>" >"$BUILD_PATH/sketch/SrcWrapper.cpp"
22+
echo "#include <SrcWrapper.h>" > "$BUILD_PATH/sketch/SrcWrapper.cpp"

0 commit comments

Comments
 (0)