-
-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build.extra_flags breaks nested include in a .h file #2041
Comments
Hi @DaleSchultz. Thanks for taking the time to submit an issue. I see you are using an older version of the ESP8266 boards platform. The https://github.com/esp8266/Arduino/blob/3.0.2/platform.txt#L86
This means the https://github.com/tzapu/WiFiManager/blob/v2.0.15-rc.1/WiFiManager.h#L17 #if defined(ESP8266) || defined(ESP32)
[...]
class WiFiManager
[...]
#endif So you can see now why your sketch no longer compiles. The In this case, you would want to include the original value in your new customized value for the property:
There is a proposal about making platforms more friendly to customization by the user via the |
Thanks for the explanation of what was happening. Is my understanding correct that all the existing board build properties are replaced with whatever build property is defined on the compile command? If so perhaps the documentation for the compile should be updated to indicate that. At present it states:
which makes it sound as if a single property can be customized. Perhaps that should read:
I was very much looking for a 'user' side ability to set a define at compile time, so I will add my use case to that discussion. |
No. It only overrides the build property specified via the flag. So in your command, the value specified via the
That is exactly what it does.
You have one already. You just need to make sure your use of a property doesn't conflict with the use of the property in the platform. The https://github.com/esp8266/Arduino/blob/3.0.2/platform.txt#L88-L95 In a platform that is respecting the intended use of those properties, as is the case with the ESP8266 platform, the user can set them via |
Describe the problem
I have a file called
utils.h
which I include from my main.ino
sketchutils.h
has:#include <WiFiManager.h>
The app builds fine in Arduino IDE and also with arduino-cli with this command:
However if I add a
--build-property
like this:The build fails claiming
WifiManager
has not been declared:I accept that perhaps my utils should be a pair of
.h
and.cpp
files (I have code in the.h
file) but it is the case that it all works perfectly without the--build-properties
flag.Here is the minimized
utils.h
file:and the
include.ino
file:To reproduce
<WiFiManager.h>
installedinclude.ino
andutils.h
in a foldercd
to the folderExpected behavior
I expect the build to succeed with both compile commands.
Arduino CLI version
nightly-20230122 Commit: a58d5ad Date: 2023-01-22T01:33:46Z
Operating system
Windows
Operating system version
11
Additional context
No response
Issue checklist
The text was updated successfully, but these errors were encountered: