Skip to content

Commit e0e367b

Browse files
committed
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`: arduino#633 (comment)
1 parent 740aecf commit e0e367b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Diff for: legacy/builder/gcc_preproc_runner.go

+1
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

Diff for: legacy/builder/setup_build_properties.go

+1
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)