Warn about calling “env.BuildSources” in a POST-type script // Resolve #4385

This commit is contained in:
Ivan Kravets
2022-08-08 17:39:36 +03:00
parent 8c13d13f80
commit dfffd5e97b
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -341,6 +341,14 @@ def BuildLibrary(env, variant_dir, src_dir, src_filter=None, nodes=None):
def BuildSources(env, variant_dir, src_dir, src_filter=None):
if env.get("PIOMAINPROG"):
sys.stderr.write(
"Error: The main program is already constructed and the inline "
"source files are not allowed. Please use `env.BuildLibrary(...)` "
"or PRE-type script instead."
)
env.Exit(1)
nodes = env.CollectBuildFiles(variant_dir, src_dir, src_filter)
DefaultEnvironment().Append(
PIOBUILDFILES=[