Updated sdkconfig files should trigger CMake to regenerate project
Resolve #588
This commit is contained in:
@@ -109,6 +109,7 @@ def is_cmake_reconfigure_required(cmake_api_reply_dir):
|
|||||||
os.path.join(PROJECT_SRC_DIR, "CMakeLists.txt"),
|
os.path.join(PROJECT_SRC_DIR, "CMakeLists.txt"),
|
||||||
]
|
]
|
||||||
cmake_preconf_dir = os.path.join(BUILD_DIR, "config")
|
cmake_preconf_dir = os.path.join(BUILD_DIR, "config")
|
||||||
|
deafult_sdk_config = os.path.join(PROJECT_DIR, "sdkconfig.defaults")
|
||||||
|
|
||||||
for d in (cmake_api_reply_dir, cmake_preconf_dir):
|
for d in (cmake_api_reply_dir, cmake_preconf_dir):
|
||||||
if not os.path.isdir(d) or not os.listdir(d):
|
if not os.path.isdir(d) or not os.listdir(d):
|
||||||
@@ -117,10 +118,14 @@ def is_cmake_reconfigure_required(cmake_api_reply_dir):
|
|||||||
return True
|
return True
|
||||||
if not os.path.isfile(os.path.join(BUILD_DIR, "build.ninja")):
|
if not os.path.isfile(os.path.join(BUILD_DIR, "build.ninja")):
|
||||||
return True
|
return True
|
||||||
if os.path.isfile(SDKCONFIG_PATH) and os.path.getmtime(
|
if not os.path.isfile(SDKCONFIG_PATH) or os.path.getmtime(
|
||||||
SDKCONFIG_PATH
|
SDKCONFIG_PATH
|
||||||
) > os.path.getmtime(cmake_cache_file):
|
) > os.path.getmtime(cmake_cache_file):
|
||||||
return True
|
return True
|
||||||
|
if os.path.isfile(deafult_sdk_config) and os.path.getmtime(
|
||||||
|
deafult_sdk_config
|
||||||
|
) > os.path.getmtime(cmake_cache_file):
|
||||||
|
return True
|
||||||
if any(
|
if any(
|
||||||
os.path.getmtime(f) > os.path.getmtime(cmake_cache_file)
|
os.path.getmtime(f) > os.path.getmtime(cmake_cache_file)
|
||||||
for f in cmake_txt_files + [cmake_preconf_dir, FRAMEWORK_DIR]
|
for f in cmake_txt_files + [cmake_preconf_dir, FRAMEWORK_DIR]
|
||||||
|
|||||||
Reference in New Issue
Block a user