@@ -96,18 +96,27 @@ def is_cmake_reconfigure_required() -> bool:
9696 ninja_buildfile = BUILD_DIR / "build.ninja"
9797
9898 if not cmake_cache_file .exists ():
99+ print (f"Mbed CE: Reconfigure required because CMake cache does not exist" )
99100 return True
100101 if not CMAKE_API_REPLY_DIR .is_dir () or not any (CMAKE_API_REPLY_DIR .iterdir ()):
102+ print ("Mbed CE: Reconfigure required because CMake API reply dir is missing" )
101103 return True
102104 if not ninja_buildfile .exists ():
105+ print ("Mbed CE: Reconfigure required because Ninja buildfile does not exist" )
103106 return True
104107
105108 # If the JSON files have 'Debug' in their names that means this project was previously configured as Debug.
106109 if not any (CMAKE_API_REPLY_DIR .glob (f"directory-*{ CMAKE_BUILD_TYPE } *.json" )):
110+ print ("Mbed CE: Reconfigure required because build type (debug / release) changed." )
107111 return True
108112
109113 cache_file_mtime = cmake_cache_file .stat ().st_mtime
110- return any (file .stat ().st_mtime > cache_file_mtime for file in cmake_config_files )
114+ for file in cmake_config_files :
115+ if file .stat ().st_mtime > cache_file_mtime :
116+ print (f"Mbed CE: Reconfigure required because { file .name } was modified" )
117+ return True
118+
119+ return False
111120
112121
113122def run_tool (command_and_args : list [str ] | None = None ) -> None :
@@ -121,6 +130,8 @@ def run_tool(command_and_args: list[str] | None = None) -> None:
121130 env .Exit (1 )
122131
123132 if int (ARGUMENTS .get ("PIOVERBOSE" , 0 )):
133+ print (result ["out" ])
134+ print (result ["err" ])
124135 pass
125136
126137
@@ -135,6 +146,7 @@ def get_cmake_code_model(cmake_args: list) -> dict:
135146 create_default_project_files ()
136147
137148 if is_cmake_reconfigure_required ():
149+ print ("Mbed CE: Configuring CMake build system..." )
138150 cmake_command = [str (CMAKE_PATH ), * cmake_args ]
139151 run_tool (cmake_command )
140152
@@ -254,6 +266,7 @@ def get_app_defines(app_config: dict) -> list[tuple[str, str]]:
254266 print ("Error: Couldn't find code model generated by CMake" , file = sys .stderr )
255267 env .Exit (1 )
256268
269+ print ("Mbed CE: Reading CMake configuration..." )
257270target_configs = load_target_configurations (project_codemodel )
258271
259272framework_components_map = get_components_map (target_configs , ["STATIC_LIBRARY" , "OBJECT_LIBRARY" ], [])
@@ -300,6 +313,9 @@ def get_app_defines(app_config: dict) -> list[tuple[str, str]]:
300313# Run Ninja to produce the linker script.
301314# Note that this seems to execute CMake, causing the code model query to be re-done.
302315# So, we have to do this after we are done using the results of said query.
316+ print ("Mbed CE: Generating linker script..." )
303317project_ld_script = generate_project_ld_script ()
304318_ = env .Depends ("$BUILD_DIR/$PROGNAME$PROGSUFFIX" , str (project_ld_script ))
305319env .Append (LDSCRIPT_PATH = str (project_ld_script ))
320+
321+ print ("Mbed CE: Build environment configured." )
0 commit comments