@@ -272,7 +272,7 @@ func (l *SketchLibrariesDetector) findIncludes(
272
272
// Pre-run cache entries
273
273
l .preRunner = runner .New (ctx , jobs )
274
274
for _ , entry := range l .cache .EntriesAhead () {
275
- if entry .Compile != nil && entry . CompileTask != nil {
275
+ if entry .CompileTask != nil {
276
276
upToDate , _ := entry .Compile .ObjFileIsUpToDate ()
277
277
if ! upToDate {
278
278
_ = entry .Compile .PrepareBuildPath ()
@@ -351,7 +351,7 @@ func (l *SketchLibrariesDetector) findIncludes(
351
351
return nil
352
352
}
353
353
354
- func (l * SketchLibrariesDetector ) gccPreprocessTask (sourceFile * sourceFile , buildProperties * properties.Map ) * runner.Task {
354
+ func (l * SketchLibrariesDetector ) gccPreprocessTask (sourceFile sourceFile , buildProperties * properties.Map ) * runner.Task {
355
355
// Libraries may require the "utility" directory to be added to the include
356
356
// search path, but only for the source code of the library, so we temporary
357
357
// copy the current search path list and add the library' utility directory
@@ -517,7 +517,7 @@ func (l *SketchLibrariesDetector) queueSourceFilesFromFolder(
517
517
518
518
// makeSourceFile create a sourceFile object for the given source file path.
519
519
// The given sourceFilePath can be absolute, or relative within the sourceRoot root folder.
520
- func (l * SketchLibrariesDetector ) makeSourceFile (sourceRoot , buildRoot , sourceFilePath * paths.Path , extraIncludePaths ... * paths.Path ) (* sourceFile , error ) {
520
+ func (l * SketchLibrariesDetector ) makeSourceFile (sourceRoot , buildRoot , sourceFilePath * paths.Path , extraIncludePaths ... * paths.Path ) (sourceFile , error ) {
521
521
if len (extraIncludePaths ) > 1 {
522
522
panic ("only one extra include path allowed" )
523
523
}
@@ -530,15 +530,14 @@ func (l *SketchLibrariesDetector) makeSourceFile(sourceRoot, buildRoot, sourceFi
530
530
var err error
531
531
sourceFilePath , err = sourceRoot .RelTo (sourceFilePath )
532
532
if err != nil {
533
- return nil , err
533
+ return sourceFile {} , err
534
534
}
535
535
}
536
- res := & sourceFile {
536
+ return sourceFile {
537
537
SourcePath : sourceRoot .JoinPath (sourceFilePath ),
538
538
DepfilePath : buildRoot .Join (fmt .Sprintf ("%s.libsdetect.d" , sourceFilePath )),
539
539
ExtraIncludePath : extraIncludePath ,
540
- }
541
- return res , nil
540
+ }, nil
542
541
}
543
542
544
543
func (l * SketchLibrariesDetector ) failIfImportedLibraryIsWrong () error {
0 commit comments