mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-09-12 17:45:49 +00:00
In order to be able to build in Windows, we need to concatenate all .cpp files in some folders to reduce the number of compiled object files. This is needed due to the limitation of Windows to have a command line longer than 32767 characters. The linker command was becoming longer than this maximum. However the DataStructs folder does have at least one templated .cpp file. Since you may need to include a .cpp file if it contains a templated class, the DataStruct folder could not be concatenated into a single .cpp file. Therefore the templated class(es) will be stored in a folder postfixed with _templ
31 lines
1.0 KiB
Python
31 lines
1.0 KiB
Python
Import("env")
|
|
import os
|
|
|
|
|
|
|
|
def clear_concat_cpp_files(path_to_concat):
|
|
cpp_path_out = '{}_tmp'.format(path_to_concat)
|
|
tmp_cpp_file = os.path.join(cpp_path_out, '__tmpfile.cpp')
|
|
|
|
if os.path.exists(tmp_cpp_file):
|
|
print("\u001b[33m Delete: \u001b[0m {}".format(tmp_cpp_file))
|
|
os.remove(tmp_cpp_file)
|
|
|
|
if os.path.exists(cpp_path_out):
|
|
os.rmdir(cpp_path_out)
|
|
|
|
|
|
def clear_all_concat_cpp_files(source, target, env):
|
|
print("\u001b[32m Remove temp concatenated files \u001b[0m")
|
|
clear_concat_cpp_files('./src/src/Commands')
|
|
clear_concat_cpp_files('./src/src/ControllerQueue')
|
|
clear_concat_cpp_files('./src/src/DataStructs')
|
|
clear_concat_cpp_files('./src/src/DataTypes')
|
|
clear_concat_cpp_files('./src/src/Globals')
|
|
clear_concat_cpp_files('./src/src/Helpers')
|
|
clear_concat_cpp_files('./src/src/PluginStructs')
|
|
clear_concat_cpp_files('./src/src/WebServer')
|
|
print("\u001b[32m ------------------------------ \u001b[0m")
|
|
|
|
|
|
#env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [clear_all_concat_cpp_files]) |