From e7a2a1cc2a9903957534d894070581dfd5ab619f Mon Sep 17 00:00:00 2001 From: James Foster Date: Sat, 24 Oct 2020 18:59:04 -0700 Subject: [PATCH 1/2] Add `__AVR__` to defines to match Arduino IDE compiler (seems to be expected by some headers; see https://github.com/arduino-libraries/SD/blob/master/src/utility/Sd2PinMap.h:47. --- CHANGELOG.md | 1 + lib/arduino_ci/cpp_library.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfeb713c..fdfd1083 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] ### Added +- Add `__AVR__` to defines when compiling ### Changed - Move repository from https://github.com/ianfixes/arduino_ci to https://github.com/Arduino-CI/arduino_ci diff --git a/lib/arduino_ci/cpp_library.rb b/lib/arduino_ci/cpp_library.rb index 4fbb43d0..83c056a9 100644 --- a/lib/arduino_ci/cpp_library.rb +++ b/lib/arduino_ci/cpp_library.rb @@ -324,7 +324,7 @@ def build_for_test_with_configuration(test_file, aux_libraries, gcc_binary, ci_g executable = Pathname.new("unittest_#{base}.bin").expand_path File.delete(executable) if File.exist?(executable) arg_sets = [] - arg_sets << ["-std=c++0x", "-o", executable.to_s, "-DARDUINO=100"] + arg_sets << ["-std=c++0x", "-o", executable.to_s, "-DARDUINO=100", "-D__ARV__"] if libasan?(gcc_binary) arg_sets << [ # Stuff to help with dynamic memory mishandling "-g", "-O1", From a299603696171c53ec0a44da1a082653f9720d8f Mon Sep 17 00:00:00 2001 From: James Foster Date: Sat, 24 Oct 2020 21:17:43 -0700 Subject: [PATCH 2/2] Fix macro name. --- lib/arduino_ci/cpp_library.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/arduino_ci/cpp_library.rb b/lib/arduino_ci/cpp_library.rb index 83c056a9..42323be2 100644 --- a/lib/arduino_ci/cpp_library.rb +++ b/lib/arduino_ci/cpp_library.rb @@ -324,7 +324,7 @@ def build_for_test_with_configuration(test_file, aux_libraries, gcc_binary, ci_g executable = Pathname.new("unittest_#{base}.bin").expand_path File.delete(executable) if File.exist?(executable) arg_sets = [] - arg_sets << ["-std=c++0x", "-o", executable.to_s, "-DARDUINO=100", "-D__ARV__"] + arg_sets << ["-std=c++0x", "-o", executable.to_s, "-DARDUINO=100", "-D__AVR__"] if libasan?(gcc_binary) arg_sets << [ # Stuff to help with dynamic memory mishandling "-g", "-O1",