lib/blocks/compile.rb in bake-toolkit-2.9.2 vs lib/blocks/compile.rb in bake-toolkit-2.10.0

- old
+ new

@@ -30,19 +30,19 @@ adaptedSource = source.chomp(File.extname(source)).gsub(/\.\./, "##") + (Bake.options.prepro ? ".i" : @tcs[:COMPILER][:CPP][:OBJECT_FILE_ENDING]) return adaptedSource if File.is_absolute?source File.join([@output_dir, adaptedSource]) end - def needed?(source, object, type, dep_filename_conv) + def maybe_needed?(source, object, type, dep_filename_conv) return false if Bake.options.linkOnly - + return false if Bake.options.prepro and type == ASM + return true + end + + def needed?(source, object, type, dep_filename_conv) return "because analyzer toolchain is configured" if Bake.options.analyze - - if Bake.options.prepro - return "because prepro was specified and source is no assembler file" if type != :ASM - return false - end + return "because prepro was specified and source is no assembler file" if Bake.options.prepro return "because object does not exist" if not File.exist?(object) oTime = File.mtime(object) return "because source is newer than object" if oTime < File.mtime(source) @@ -112,9 +112,11 @@ dep_filename = calcDepFile(object, type) dep_filename_conv = calcDepFileConv(dep_filename) if type != :ASM cmdLineCheck = false cmdLineFile = calcCmdlineFile(object) + return true unless maybe_needed?(source, object, type, dep_filename_conv) + reason = needed?(source, object, type, dep_filename_conv) if not reason cmdLineCheck = true reason = config_changed?(cmdLineFile) end \ No newline at end of file