diff --git a/i18n/data/en.po b/i18n/data/en.po index 50dab89fbc4..4855ee35469 100644 --- a/i18n/data/en.po +++ b/i18n/data/en.po @@ -395,7 +395,7 @@ msgstr "Compiling core..." msgid "Compiling libraries..." msgstr "Compiling libraries..." -#: legacy/builder/phases/libraries_builder.go:135 +#: legacy/builder/phases/libraries_builder.go:136 msgid "Compiling library \"{0}\"" msgstr "Compiling library \"{0}\"" @@ -1358,7 +1358,7 @@ msgstr "Library installed" msgid "Library name" msgstr "Library name" -#: legacy/builder/phases/libraries_builder.go:91 +#: legacy/builder/phases/libraries_builder.go:92 msgid "Library {0} has been declared precompiled:" msgstr "Library {0} has been declared precompiled:" @@ -1745,8 +1745,8 @@ msgstr "Port closed:" msgid "Port monitor error" msgstr "Port monitor error" -#: legacy/builder/phases/libraries_builder.go:101 -#: legacy/builder/phases/libraries_builder.go:109 +#: legacy/builder/phases/libraries_builder.go:102 +#: legacy/builder/phases/libraries_builder.go:110 msgid "Precompiled library in \"{0}\" not found" msgstr "Precompiled library in \"{0}\" not found" @@ -2069,7 +2069,7 @@ msgstr "The key '%[1]v' is not a list of items, can't remove from it.\n" msgid "The output format for the logs, can be: %s" msgstr "The output format for the logs, can be: %s" -#: legacy/builder/phases/libraries_builder.go:151 +#: legacy/builder/phases/libraries_builder.go:152 msgid "The platform does not support '{0}' for precompiled libraries." msgstr "The platform does not support '{0}' for precompiled libraries." @@ -2333,8 +2333,8 @@ msgstr "Using library {0} in folder: {1} {2}" msgid "Using precompiled core: {0}" msgstr "Using precompiled core: {0}" -#: legacy/builder/phases/libraries_builder.go:98 -#: legacy/builder/phases/libraries_builder.go:106 +#: legacy/builder/phases/libraries_builder.go:99 +#: legacy/builder/phases/libraries_builder.go:107 msgid "Using precompiled library in {0}" msgstr "Using precompiled library in {0}" diff --git a/legacy/builder/phases/libraries_builder.go b/legacy/builder/phases/libraries_builder.go index a5253f76303..a3d107d002b 100644 --- a/legacy/builder/phases/libraries_builder.go +++ b/legacy/builder/phases/libraries_builder.go @@ -37,7 +37,8 @@ type LibrariesBuilder struct{} func (s *LibrariesBuilder) Run(ctx *types.Context) error { librariesBuildPath := ctx.LibrariesBuildPath buildProperties := ctx.BuildProperties - includes := utils.Map(ctx.IncludeFolders.AsStrings(), utils.WrapWithHyphenI) + libFolders := append(ctx.IncludeFolders.AsStrings(), ctx.BuildPath.Join("sketch").Join("libdefs").String()) // user definitions for library include files + includes := utils.Map(libFolders, utils.WrapWithHyphenI) libs := ctx.ImportedLibraries if err := librariesBuildPath.MkdirAll(); err != nil { diff --git a/legacy/builder/phases/sketch_builder.go b/legacy/builder/phases/sketch_builder.go index 8fea0f129c0..3ad391228db 100644 --- a/legacy/builder/phases/sketch_builder.go +++ b/legacy/builder/phases/sketch_builder.go @@ -27,7 +27,8 @@ type SketchBuilder struct{} func (s *SketchBuilder) Run(ctx *types.Context) error { sketchBuildPath := ctx.SketchBuildPath buildProperties := ctx.BuildProperties - includes := utils.Map(ctx.IncludeFolders.AsStrings(), utils.WrapWithHyphenI) + libFolders := append(ctx.IncludeFolders.AsStrings(), ctx.BuildPath.Join("sketch").Join("libdefs").String()) // user definitions for library include files + includes := utils.Map(libFolders, utils.WrapWithHyphenI) if err := sketchBuildPath.MkdirAll(); err != nil { return errors.WithStack(err) diff --git a/test/testdata/sketch_with_multiple_custom_libraries/libdefs/lib2_user_config.h b/test/testdata/sketch_with_multiple_custom_libraries/libdefs/lib2_user_config.h new file mode 100644 index 00000000000..e8ea284f7ec --- /dev/null +++ b/test/testdata/sketch_with_multiple_custom_libraries/libdefs/lib2_user_config.h @@ -0,0 +1,8 @@ + +// This user file is in 'sketchDir/libdefs/' so it can be included by libraries. +// +// Its name and what to include is specified by the library documentation. + +#pragma once + +#define LIB2_SOME_CONFIG 1 diff --git a/test/testdata/sketch_with_multiple_custom_libraries/libraries2/Lib/lib2.h b/test/testdata/sketch_with_multiple_custom_libraries/libraries2/Lib/lib2.h index e69de29bb2d..5cea15b7756 100644 --- a/test/testdata/sketch_with_multiple_custom_libraries/libraries2/Lib/lib2.h +++ b/test/testdata/sketch_with_multiple_custom_libraries/libraries2/Lib/lib2.h @@ -0,0 +1,14 @@ + +#if defined __has_include +# if __has_include () +# pragma message "Including local project config file " +# include +# define DEFAULT_VALUES_ARE_GIVEN 1 +# endif +#endif + +#ifndef LIB2_SOME_CONFIG +#define LIB2_SOME_CONFIG 0 +#endif + +#define LIB2_SOME_SIZE ((LIB2_SOME_CONFIG) * 42) diff --git a/test/testdata/sketch_with_multiple_custom_libraries/sketch_with_multiple_custom_libraries.ino b/test/testdata/sketch_with_multiple_custom_libraries/sketch_with_multiple_custom_libraries.ino index fb99d2a57ee..8633af92e29 100644 --- a/test/testdata/sketch_with_multiple_custom_libraries/sketch_with_multiple_custom_libraries.ino +++ b/test/testdata/sketch_with_multiple_custom_libraries/sketch_with_multiple_custom_libraries.ino @@ -1,6 +1,10 @@ #include "lib1.h" #include "lib2.h" +#if LIB2_SOME_SIZE == 42 +#pragma message "this was expected" +#endif + void setup() { } 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