kopia lustrzana https://github.com/espressif/esp-idf
docs: Re-run the 'set-target' target each time, use a unique sdkconfig file for each lang/target combo
Fixes some problems with CMake errors in stale builds, and of sdkconfig file being shared between parallel jobs.pull/2405/merge
rodzic
54e7cb4d8b
commit
2c03d2cc4e
|
@ -7,6 +7,7 @@
|
||||||
# Then emits the new 'idf-info' event which has information read from IDF
|
# Then emits the new 'idf-info' event which has information read from IDF
|
||||||
# build system, that other extensions can use to generate relevant data.
|
# build system, that other extensions can use to generate relevant data.
|
||||||
import os.path
|
import os.path
|
||||||
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
import json
|
import json
|
||||||
|
@ -61,15 +62,19 @@ def generate_idf_info(app, config):
|
||||||
"-B",
|
"-B",
|
||||||
cmake_build_dir,
|
cmake_build_dir,
|
||||||
"-C",
|
"-C",
|
||||||
project_path]
|
project_path,
|
||||||
if not os.path.exists(os.path.join(cmake_build_dir, "CMakeCache.txt")):
|
"-D",
|
||||||
# if build directory not created yet, run a reconfigure pass over it
|
"SDKCONFIG={}".format(os.path.join(build_dir, "dummy_project_sdkconfig"))
|
||||||
print("Starting new dummy IDF project... w")
|
]
|
||||||
subprocess.check_call(idf_py + ["set-target", app.config.idf_target])
|
|
||||||
else:
|
|
||||||
print("Re-running CMake on the existing IDF project in {}".format(cmake_build_dir))
|
|
||||||
|
|
||||||
|
# force a clean idf.py build w/ new sdkconfig each time
|
||||||
|
# (not much slower than 'reconfigure', avoids any potential config & build versioning problems
|
||||||
|
shutil.rmtree(cmake_build_dir, ignore_errors=True)
|
||||||
|
print("Starting new dummy IDF project... ")
|
||||||
|
subprocess.check_call(idf_py + ["set-target", app.config.idf_target])
|
||||||
|
print("Running CMake on dummy project...")
|
||||||
subprocess.check_call(idf_py + ["reconfigure"])
|
subprocess.check_call(idf_py + ["reconfigure"])
|
||||||
|
|
||||||
with open(os.path.join(cmake_build_dir, "project_description.json")) as f:
|
with open(os.path.join(cmake_build_dir, "project_description.json")) as f:
|
||||||
project_description = json.load(f)
|
project_description = json.load(f)
|
||||||
if project_description["target"] != app.config.idf_target:
|
if project_description["target"] != app.config.idf_target:
|
||||||
|
|
Ładowanie…
Reference in New Issue