Skip to content

Commit

Permalink
Merge branch 'platformio:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
DogushC authored Dec 23, 2024
2 parents f2ed07a + 492d38b commit 62891f4
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion builder/frameworks/espidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,15 @@ def is_cmake_reconfigure_required(cmake_api_reply_dir):
]
cmake_preconf_dir = os.path.join(BUILD_DIR, "config")
deafult_sdk_config = os.path.join(PROJECT_DIR, "sdkconfig.defaults")
idf_deps_lock = os.path.join(PROJECT_DIR, "dependencies.lock")
ninja_buildfile = os.path.join(BUILD_DIR, "build.ninja")

for d in (cmake_api_reply_dir, cmake_preconf_dir):
if not os.path.isdir(d) or not os.listdir(d):
return True
if not os.path.isfile(cmake_cache_file):
return True
if not os.path.isfile(os.path.join(BUILD_DIR, "build.ninja")):
if not os.path.isfile(ninja_buildfile):
return True
if not os.path.isfile(SDKCONFIG_PATH) or os.path.getmtime(
SDKCONFIG_PATH
Expand All @@ -155,6 +157,10 @@ def is_cmake_reconfigure_required(cmake_api_reply_dir):
deafult_sdk_config
) > os.path.getmtime(cmake_cache_file):
return True
if os.path.isfile(idf_deps_lock) and os.path.getmtime(
idf_deps_lock
) > os.path.getmtime(ninja_buildfile):
return True
if any(
os.path.getmtime(f) > os.path.getmtime(cmake_cache_file)
for f in cmake_txt_files + [cmake_preconf_dir, FRAMEWORK_DIR]
Expand Down Expand Up @@ -271,6 +277,13 @@ def populate_idf_env_vars(idf_env):
if "IDF_TOOLS_PATH" in idf_env:
del idf_env["IDF_TOOLS_PATH"]

# Unlike IDF, PlatformIO allows multiple targets per environment. This
# difference may cause CMake configuration errors if the automatically
# handled folder "managed_components" was modified on the disk by
# a previous target
if board.get("build.esp-idf.overwrite_managed_components", "yes") == "yes":
idf_env["IDF_COMPONENT_OVERWRITE_MANAGED_COMPONENTS"] = "1"


def get_target_config(project_configs, target_index, cmake_api_reply_dir):
target_json = project_configs.get("targets")[target_index].get("jsonFile", "")
Expand Down

0 comments on commit 62891f4

Please sign in to comment.