Skip to content

[Cleanup] Move WebServer_*.ino files (and some more) to .cpp/.h#3307

Merged
TD-er merged 27 commits intoletscontrolit:megafrom
TD-er:build/convert_ino_cpp_h
Oct 22, 2020
Merged

[Cleanup] Move WebServer_*.ino files (and some more) to .cpp/.h#3307
TD-er merged 27 commits intoletscontrolit:megafrom
TD-er:build/convert_ino_cpp_h

Conversation

@TD-er
Copy link
Copy Markdown
Member

@TD-er TD-er commented Oct 10, 2020

Since PlatformIO 5.0 the build environment crashes quite often in VS code as it was generating a temp .cpp file from all .ino files.
This process, combined with Intellisense indexing this file, lead to lots of Extension Host crashes as it ran out of memory.

To keep on working on ESPEasy development, it is needed to convert the .ino files to .cpp/.h files.
Not only does it no longer lead to crashes during development, but also the builds are way more predictable compared to when using .ino files.

When compiling .ino files, there is no guarantee which order they will be compiled and thus it is also not guaranteed the needed defines are set correct.
This has led to numerous issues in the past.

@TD-er
Copy link
Copy Markdown
Member Author

TD-er commented Oct 11, 2020

It appeared the #include "ESPEasy_common.h" was not always done right, so this could lead to situations where code depends on defines set in Custom.h (or other build depending defines) was not always the same during the compile of various parts of the code and also possible to fluctuate per set of used defines.

So now all .h and .cpp files depending on defines like USES_xxx now includes ESPEasy_common.h.
Also the file ESPEasy-Global.h is almost completely stripped and can soon be completely removed leaving ESPEasy_common.h as the single source of build configuration.

@TD-er TD-er force-pushed the build/convert_ino_cpp_h branch from 3baf7b2 to 37a2b0e Compare October 11, 2020 23:35
@TD-er TD-er force-pushed the build/convert_ino_cpp_h branch from 37a2b0e to cb04c67 Compare October 20, 2020 09:57
TD-er added 24 commits October 20, 2020 15:53
To be able to build again in Windows as the linker command exceeds max. command argument length in Windows.
The USES_xxx defines depend on the build config, so you need to include this _Plugin_Helper.h first before checking the `#ifdef USES_xxx`
@TD-er TD-er force-pushed the build/convert_ino_cpp_h branch from b50c14f to 019012d Compare October 20, 2020 14:21
@TD-er TD-er merged commit 94fb7f8 into letscontrolit:mega Oct 22, 2020
@TD-er TD-er deleted the build/convert_ino_cpp_h branch October 22, 2020 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants