Skip to content

Commit a89f5e6

Browse files
Explicitly define compiler.path in avr/platform.txt
Previously, this relied on an (ugly, avr-specific) magic default for the compiler.path variable, set by the IDE. This allowed the IDE to fall back to a system-wide toolchain when no bundled toolchain was found (by making compiler.path empty). However, - this only worked for avr, not sam, - this worked only for gcc, a system-wide avrdude would break on the avrdude.conf path in platform.txt, and This would mean that automatic system-wide fallback didn't work in all situations, so you'd still have to modify platform.txt (or create platform.local.txt). Since doing that explictly is the most reliable way, this commit removes the partial-working ability to do this automatically. Note that the code to automatically set compiler.path is still kept around, in case third-party hardware still relies on this. At some point, this code should be removed, but for now it just shows a warning message.
1 parent d2ec056 commit a89f5e6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Diff for: app/src/processing/app/debug/Compiler.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,14 @@ private PreferencesMap createBuildPreferences(String _buildPath,
197197
targetArch = targetPlatform.getId();
198198
p.put("build.arch", targetArch.toUpperCase());
199199

200-
if (!p.containsKey("compiler.path"))
200+
// Platform.txt should define its own compiler.path. For
201+
// compatibility with earlier 1.5 versions, we define a (ugly,
202+
// avr-specific) default for it, but this should be removed at some
203+
// point.
204+
if (!p.containsKey("compiler.path")) {
205+
System.err.println(_("Third-party platform.txt does not define compiler.path. Please report this to the third-party hardware maintainer."));
201206
p.put("compiler.path", Base.getAvrBasePath());
207+
}
202208

203209
// Core folder
204210
TargetPlatform tp = corePlatform;

Diff for: hardware/arduino/avr/platform.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ version=1.5.6
1212
# ---------------------
1313

1414
# Default "compiler.path" is correct, change only if you want to overidde the initial value
15-
#compiler.path={ide.path}/tools/avr/bin/..
15+
compiler.path={runtime.ide.path}/hardware/tools/avr/bin/
1616
compiler.c.cmd=avr-gcc
1717
compiler.c.flags=-c -g -Os -w -ffunction-sections -fdata-sections -MMD
1818
compiler.c.elf.flags=-Os -Wl,--gc-sections

0 commit comments

Comments
 (0)