Skip to content

Commit 2d7e3d1

Browse files
authored
Fix -DARDUINO_LIB_DISCOVERY_PHASE automatic flag incompatiblity in some rare circumstances (#838)
* Revert "Add macro -DARDUINO_LIB_DISCOVERY_PHASE during lib discovery phase (#633)" This reverts commit 985b2c9. * Set {build.library_discovery_phase} to 1 during lib discovery Previously we used to add `-DARDUINO_LIB_DISCOVERY_PHASE` to the gcc command line but this produced some incompatiblity with compilers using non-standard `-d` flag instead of `-D`: #633 (comment)
1 parent 858cda3 commit 2d7e3d1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

legacy/builder/gcc_preproc_runner.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ func GCCPreprocRunnerForDiscoveringIncludes(ctx *types.Context, sourceFilePath *
5757

5858
func prepareGCCPreprocRecipeProperties(ctx *types.Context, sourceFilePath *paths.Path, targetFilePath *paths.Path, includes paths.PathList) (*exec.Cmd, error) {
5959
properties := ctx.BuildProperties.Clone()
60+
properties.Set("build.library_discovery_phase", "1")
6061
properties.SetPath(constants.BUILD_PROPERTIES_SOURCE_FILE, sourceFilePath)
6162
properties.SetPath(constants.BUILD_PROPERTIES_PREPROCESSED_FILE_PATH, targetFilePath)
6263

@@ -77,8 +78,6 @@ func prepareGCCPreprocRecipeProperties(ctx *types.Context, sourceFilePath *paths
7778
// to create a /dev/null.d dependency file, which won't work.
7879
cmd.Args = utils.Filter(cmd.Args, func(a string) bool { return a != "-MMD" })
7980

80-
cmd.Args = append(cmd.Args, "-DARDUINO_LIB_DISCOVERY_PHASE")
81-
8281
return cmd, nil
8382
}
8483

legacy/builder/setup_build_properties.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func (s *SetupBuildProperties) Run(ctx *types.Context) error {
6767
buildProperties.Set("build.fqbn", ctx.FQBN.String())
6868
buildProperties.Set("ide_version", ctx.ArduinoAPIVersion)
6969
buildProperties.Set("runtime.os", properties.GetOSSuffix())
70+
buildProperties.Set("build.library_discovery_phase", "0")
7071

7172
if ctx.OptimizeForDebug {
7273
if buildProperties.ContainsKey("compiler.optimization_flags.debug") {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy