cmake: Fix issues when IDF_PATH is not set in environment

Support cases where IDF_PATH may be passed in on the cmake command line,
or inferred from a (hardcoded absolute or relative) path to project.cmake
This commit is contained in:
Angus Gratton
2018-06-15 14:59:45 +10:00
committed by Angus Gratton
parent be829afe6e
commit bf10447b82
6 changed files with 50 additions and 8 deletions

View File

@@ -41,7 +41,7 @@ class FatalError(RuntimeError):
PYTHON=sys.executable
# note: os.environ changes don't automatically propagate to child processes,
# you have to pass this in explicitly
# you have to pass env=os.environ explicitly anywhere that we create a process
os.environ["PYTHON"]=sys.executable
# Make flavors, across the various kinds of Windows environments & POSIX...
@@ -95,6 +95,7 @@ def check_environment():
print("WARNING: IDF_PATH environment variable is set to %s but idf.py path indicates IDF directory %s. Using the environment variable directory, but results may be unexpected..."
% (set_idf_path, detected_idf_path))
else:
print("Setting IDF_PATH environment variable: %s" % detected_idf_path)
os.environ["IDF_PATH"] = detected_idf_path
def executable_exists(args):