Skip to content

Commit 40372d7

Browse files
facchinmcmaglie
authored andcommitted
Check for modifications also in referenced core
1 parent 2444448 commit 40372d7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/arduino.cc/builder/phases/core_builder.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636
"arduino.cc/builder/types"
3737
"arduino.cc/builder/utils"
3838
"arduino.cc/properties"
39+
"strings"
3940
)
4041

4142
type CoreBuilder struct{}
@@ -67,6 +68,8 @@ func compileCore(buildPath string, buildProperties properties.Map, verbose bool,
6768
coreFolder := buildProperties[constants.BUILD_PROPERTIES_BUILD_CORE_PATH]
6869
variantFolder := buildProperties[constants.BUILD_PROPERTIES_BUILD_VARIANT_PATH]
6970

71+
targetCoreFolder := buildProperties[constants.BUILD_PROPERTIES_RUNTIME_PLATFORM_PATH]
72+
7073
includes := []string{}
7174
includes = append(includes, coreFolder)
7275
if variantFolder != constants.EMPTY_STRING {
@@ -90,6 +93,11 @@ func compileCore(buildPath string, buildProperties properties.Map, verbose bool,
9093
targetArchivedCore := builder_utils.GetCoreArchivePath(buildProperties[constants.BUILD_PROPERTIES_FQBN])
9194
noNeedToRecompile := builder_utils.CheckIfRecompileIsAvoidable(realCoreFolder, targetArchivedCore)
9295

96+
if !strings.EqualFold(realCoreFolder, targetCoreFolder) {
97+
// targetCoreFolder is not a parent of realCoreFolder, so check it for modifications
98+
noNeedToRecompile = noNeedToRecompile && builder_utils.CheckIfRecompileIsAvoidable(targetCoreFolder, targetArchivedCore)
99+
}
100+
93101
if noNeedToRecompile {
94102
// use archived core
95103
if verbose {

0 commit comments

Comments
 (0)