Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tools/python/mbed_platformio/build_mbed_ce.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def is_cmake_reconfigure_required():
ninja_buildfile = BUILD_DIR / "build.ninja"

if not cmake_cache_file.exists():
print("Mbed CE: Reconfigure required because CMake cache does not exist")
print(f"Mbed CE: Reconfigure required because CMake cache does not exist")
return True
if not CMAKE_API_REPLY_DIR.is_dir() or not any(CMAKE_API_REPLY_DIR.iterdir()):
print("Mbed CE: Reconfigure required because CMake API reply dir is missing")
Expand Down Expand Up @@ -253,7 +253,7 @@ def get_app_defines(app_config: dict):
"-DUPLOAD_METHOD=NONE", # Disable Mbed CE upload method system as PlatformIO has its own
]
+ click.parser.split_arg_string(board.get("build.cmake_extra_args", "")),
)
)

if not project_codemodel:
sys.stderr.write("Error: Couldn't find code model generated by CMake\n")
Expand Down Expand Up @@ -282,8 +282,9 @@ def get_app_defines(app_config: dict):

# Link the main Mbed OS library using -Wl,--whole-archive. This is needed for the resolution of weak symbols
# within this archive.
link_args = ["-Wl,--whole-archive", "$BUILD_DIR\\mbed-os\\libmbed-os.a", "-Wl,--no-whole-archive"]
env.Depends("$BUILD_DIR/$PROGNAME$PROGSUFFIX", "$BUILD_DIR\\mbed-os\\libmbed-os.a")
mbed_ce_lib_path = pathlib.Path("$BUILD_DIR") / "mbed-os" / "libmbed-os.a"
link_args = ["-Wl,--whole-archive", '"' + str(mbed_ce_lib_path) + '"', "-Wl,--no-whole-archive"]
env.Depends("$BUILD_DIR/$PROGNAME$PROGSUFFIX", str(mbed_ce_lib_path))

# Get other linker flags from Mbed. We want these to appear after the application objects and Mbed libraries
# because they contain the C/C++ library link flags.
Expand Down
4 changes: 2 additions & 2 deletions tools/python/mbed_platformio/cmake_to_scons_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ def _get_flags_for_compile_group(compile_group_json: dict) -> list[str]:
"""
flags = []
for ccfragment in compile_group_json["compileCommandFragments"]:
fragment = ccfragment.get("fragment", "").strip("\" ")
fragment = ccfragment.get("fragment", "").strip()
if not fragment or fragment.startswith("-D"):
continue
flags.extend(
click.parser.split_arg_string(fragment.strip())
click.parser.split_arg_string(fragment)
)
return flags

Expand Down