From 57bdacc93c99116dc6b21387e2e1a1ba43aeb76c Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 10 Apr 2014 14:47:36 +0200 Subject: [PATCH] Remove core.a before rebuilding it Before, the ar command was just ran for all .o files that should end up in core.a, which should replace any old code in core.a. However, it seems that in the unlikely event that functions or entire source files are deleted, they might linger in the core.a file. --- app/src/processing/app/debug/Compiler.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/processing/app/debug/Compiler.java b/app/src/processing/app/debug/Compiler.java index 8a38db7e9..29575b08f 100644 --- a/app/src/processing/app/debug/Compiler.java +++ b/app/src/processing/app/debug/Compiler.java @@ -703,13 +703,19 @@ public class Compiler implements MessageConsumer { if (variantFolder != null) includeFolders.add(variantFolder); + File afile = new File(buildFolder, "core.a"); + List coreObjectFiles = compileFiles(buildFolder, coreFolder, true, includeFolders); + + // Delete the .a file, to prevent any previous code from lingering + afile.delete(); + for (File file : coreObjectFiles) { PreferencesMap dict = new PreferencesMap(prefs); dict.put("ide_version", "" + Base.REVISION); - dict.put("archive_file", "core.a"); + dict.put("archive_file", afile.getName()); dict.put("object_file", file.getAbsolutePath()); String[] cmdArray;