Skip to content

Commit 57bdacc

Browse files
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.
1 parent b032f74 commit 57bdacc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/src/processing/app/debug/Compiler.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,13 +703,19 @@ void compileCore()
703703
if (variantFolder != null)
704704
includeFolders.add(variantFolder);
705705

706+
File afile = new File(buildFolder, "core.a");
707+
706708
List<File> coreObjectFiles = compileFiles(buildFolder, coreFolder, true,
707709
includeFolders);
710+
711+
// Delete the .a file, to prevent any previous code from lingering
712+
afile.delete();
713+
708714
for (File file : coreObjectFiles) {
709715

710716
PreferencesMap dict = new PreferencesMap(prefs);
711717
dict.put("ide_version", "" + Base.REVISION);
712-
dict.put("archive_file", "core.a");
718+
dict.put("archive_file", afile.getName());
713719
dict.put("object_file", file.getAbsolutePath());
714720

715721
String[] cmdArray;

0 commit comments

Comments
 (0)