diff --git a/builder_utils/utils.go b/builder_utils/utils.go index 9b4cb536..cd7895e2 100644 --- a/builder_utils/utils.go +++ b/builder_utils/utils.go @@ -248,6 +248,13 @@ func ObjFileIsUpToDate(ctx *types.Context, sourceFile, objectFile, dependencyFil logger := ctx.GetLogger() debugLevel := ctx.DebugLevel + if ctx.IgnoreDependencyCache { + if debugLevel >= 20 { + logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, "Skipping dependency detection on {0}", sourceFile) + } + return false, nil + } + if debugLevel >= 20 { logger.Fprintln(os.Stdout, constants.LOG_LEVEL_DEBUG, "Checking previous results for {0} (result = {1}, dep = {2})", sourceFile, objectFile, dependencyFile) } diff --git a/phases/libraries_builder.go b/phases/libraries_builder.go index ed0285bc..02fc578c 100644 --- a/phases/libraries_builder.go +++ b/phases/libraries_builder.go @@ -102,10 +102,12 @@ func compileLibraries(ctx *types.Context, libraries []*types.Library, buildPath for _, library := range libraries { if library.IsBeingModified { + ctx.IgnoreDependencyCache = true ctx.WarningsLevel = "all" } libraryObjectFiles, err := compileLibrary(ctx, library, buildPath, buildProperties, includes) if library.IsBeingModified { + ctx.IgnoreDependencyCache = false ctx.WarningsLevel = warningLevelToBeRestored } if err != nil { diff --git a/types/context.go b/types/context.go index e9368c08..28a4dd67 100644 --- a/types/context.go +++ b/types/context.go @@ -101,6 +101,9 @@ type Context struct { // Reuse old tools since the backing storage didn't change CanUseCachedTools bool + // Ignore dependency .d files while compiling + IgnoreDependencyCache bool + // Experimental: use arduino-preprocessor to create prototypes UseArduinoPreprocessor bool }