Skip to content

Commit a5c2d23

Browse files
author
James Foster
committed
Don't define ARDUINO=100 if already defined as something else.
1 parent 6eee41a commit a5c2d23

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1717

1818
### Fixed
1919
- Don't define `ostream& operator<<(nullptr_t)` if already defined by Apple
20+
- Don't define `ARDUINO=100` if already defined as something else
2021

2122
### Security
2223

lib/arduino_ci/cpp_library.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def build_for_test_with_configuration(test_file, aux_libraries, gcc_binary, ci_g
324324
executable = Pathname.new("unittest_#{base}.bin").expand_path
325325
File.delete(executable) if File.exist?(executable)
326326
arg_sets = []
327-
arg_sets << ["-std=c++0x", "-o", executable.to_s, "-DARDUINO=100"]
327+
arg_sets << ["-std=c++0x", "-o", executable.to_s]
328328
if libasan?(gcc_binary)
329329
arg_sets << [ # Stuff to help with dynamic memory mishandling
330330
"-g", "-O1",
@@ -334,6 +334,9 @@ def build_for_test_with_configuration(test_file, aux_libraries, gcc_binary, ci_g
334334
]
335335
end
336336
arg_sets << test_args(aux_libraries, ci_gcc_config)
337+
if (arg_sets.flatten(1).index{|s| s.include?("-DARDUINO=")} == nil)
338+
arg_sets << ["-DARDUINO=100"]
339+
end
337340
arg_sets << cpp_files_libraries(aux_libraries).map(&:to_s)
338341
arg_sets << [test_file.to_s]
339342
args = arg_sets.flatten(1)

0 commit comments

Comments
 (0)