Skip to content

Commit bab2529

Browse files
author
Federico Fissore
committed
Removing -MMD flag also from gcc -M (include finder)
Signed-off-by: Federico Fissore <[email protected]>
1 parent 7c2171a commit bab2529

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Diff for: src/arduino.cc/builder/builder_utils/utils.go

+4
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,7 @@ func ExecRecipe(properties map[string]string, recipe string, removeUnsetProperti
196196
bytes, err := command.Output()
197197
return bytes, utils.WrapError(err)
198198
}
199+
200+
func RemoveHyphenMDDFlagFromGCCCommandLine(properties map[string]string) {
201+
properties[constants.BUILD_PROPERTIES_COMPILER_CPP_FLAGS] = strings.Replace(properties[constants.BUILD_PROPERTIES_COMPILER_CPP_FLAGS], "-MMD", "", -1)
202+
}

Diff for: src/arduino.cc/builder/gcc_preproc_runner.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (s *GCCPreprocRunner) Run(context map[string]interface{}) error {
5252
includes := context[constants.CTX_INCLUDE_FOLDERS].([]string)
5353
includes = utils.Map(includes, utils.WrapWithHyphenI)
5454
properties[constants.BUILD_PROPERTIES_INCLUDES] = strings.Join(includes, constants.SPACE)
55-
removingHyphenMDDFlagFromGCCCommandLine(properties)
55+
builder_utils.RemoveHyphenMDDFlagFromGCCCommandLine(properties)
5656

5757
verbose := context[constants.CTX_VERBOSE].(bool)
5858
logger := context[constants.CTX_LOGGER].(i18n.Logger)
@@ -65,7 +65,3 @@ func (s *GCCPreprocRunner) Run(context map[string]interface{}) error {
6565

6666
return nil
6767
}
68-
69-
func removingHyphenMDDFlagFromGCCCommandLine(properties map[string]string) {
70-
properties[constants.BUILD_PROPERTIES_COMPILER_CPP_FLAGS] = strings.Replace(properties[constants.BUILD_PROPERTIES_COMPILER_CPP_FLAGS], "-MMD", "", -1)
71-
}

Diff for: src/arduino.cc/builder/includes_finder_with_gcc.go

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func (s *IncludesFinderWithGCC) Run(context map[string]interface{}) error {
4949

5050
properties := utils.MergeMapsOfStrings(make(map[string]string), buildProperties)
5151
properties[constants.BUILD_PROPERTIES_SOURCE_FILE] = filepath.Join(sketchBuildPath, filepath.Base(sketch.MainFile.Name)+".cpp")
52+
builder_utils.RemoveHyphenMDDFlagFromGCCCommandLine(properties)
5253

5354
output, err := builder_utils.ExecRecipe(properties, constants.RECIPE_PREPROC_INCLUDES, true, verbose, false, logger)
5455
if err != nil {

0 commit comments

Comments
 (0)