Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ build.flags.ldspecs=--specs=nano.specs
build.flash_offset=0

# Pre and post build hooks
build.opt.name=build_opt.h
build.opt.name=build.opt
build.opt.path={build.path}/sketch/{build.opt.name}

extras.path={build.system.path}/extras
Expand Down
11 changes: 8 additions & 3 deletions system/extras/prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ if [ ! -f "$BUILD_PATH/sketch" ]; then
mkdir -p "$BUILD_PATH/sketch"
fi

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

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