From f6088cbbe19b8deb3381fa85ad3dccc129ddb3ec Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 10 Jun 2016 19:54:17 +0300 Subject: [PATCH] Fix issue with "-L relative/path" when parsing "build_flags" // Resolve #688 --- HISTORY.rst | 2 ++ platformio/builder/tools/platformio.py | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 67209422..2b5c4c38 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -15,6 +15,8 @@ PlatformIO 2.0 (`issue #683 `_) * Added support for `Arduboy DevKit `__, the game system the size of a credit card +* Fixed issue with ``-L relative/path`` when parsing ``build_flags`` + (`issue #688 `_) 2.9.4 (2016-06-04) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 891f45ba..fb37642d 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -114,10 +114,11 @@ def ProcessFlags(env, flags): env.Append(CPPDEFINES=[flag]) env.Append(**parsed_flags) - # fix relative CPPPATH - for i, p in enumerate(env.get("CPPPATH", [])): - if isdir(p): - env['CPPPATH'][i] = realpath(p) + # fix relative CPPPATH & LIBPATH + for k in ("CPPPATH", "LIBPATH"): + for i, p in enumerate(env.get(k, [])): + if isdir(p): + env[k][i] = realpath(p) # fix relative path for "-include" for i, f in enumerate(env.get("CCFLAGS", [])): if isinstance(f, tuple) and f[0] == "-include":