Skip to content

Commit

Permalink
Reconfigure IDF project if dependencies changed
Browse files Browse the repository at this point in the history
Resolves #1514
  • Loading branch information
valeros committed Dec 19, 2024
1 parent b4e3147 commit 492d38b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 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

0 comments on commit 492d38b

Please sign in to comment.