Skip to content

Commit 014ac79

Browse files
committed
Resolved an issue with incorrect path resolution when linking static libraries via the build_flags // Resolve platformio#5004
1 parent dd3fe90 commit 014ac79

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ test-driven methodologies, and modern toolchains for unrivaled success.
2222
~~~~~~~~~~~~~~~~~~~
2323

2424
* Resolved an issue where the ``compiledb`` target failed to properly escape compiler executable paths containing spaces (`issue #4998 <https://github.com/platformio/platformio-core/issues/4998>`_)
25+
* Resolved an issue with incorrect path resolution when linking static libraries via the `build_flags <https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_flags.html>`__ option (`issue #5004 <https://github.com/platformio/platformio-core/issues/5004>`_)
2526

2627
6.1.16 (2024-09-26)
2728
~~~~~~~~~~~~~~~~~~~

platformio/builder/tools/piobuild.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ def ParseFlagsExtended(env, flags): # pylint: disable=too-many-branches
219219
if os.path.isdir(p):
220220
result[k][i] = os.path.abspath(p)
221221

222+
# fix relative LIBs
223+
for i, l in enumerate(result.get("LIBS", [])):
224+
if isinstance(l, FS.File):
225+
result["LIBS"][i] = os.path.abspath(l.get_path())
226+
222227
# fix relative path for "-include"
223228
for i, f in enumerate(result.get("CCFLAGS", [])):
224229
if isinstance(f, tuple) and f[0] == "-include":

0 commit comments

Comments
 (0)