From 4c4682f45709ad54da5293eb654bff9bbcc05c44 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 4 Mar 2016 01:45:04 +0200 Subject: [PATCH] Fix incorrect parsing of GCC "-include" flag // Resolve #552 --- HISTORY.rst | 6 +++++- platformio/__init__.py | 2 +- platformio/builder/tools/platformio.py | 7 ++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 2d8341ef..7a5b8544 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,7 +4,7 @@ Release Notes PlatformIO 2.0 -------------- -2.8.5 (2016-02-??) +2.8.5 (2016-03-??) ~~~~~~~~~~~~~~~~~~ * Project generator for `NetBeans IDE `__ @@ -31,6 +31,10 @@ PlatformIO 2.0 (`issue #550 `_) * Fixed issue with updating package which was deleted manually by user (`issue #555 `_) +* Fixed incorrect parsing of GCC ``-include`` flag + (`issue #552 `_) + +-include 2.8.4 (2016-02-17) diff --git a/platformio/__init__.py b/platformio/__init__.py index a1c249e7..92ab3db3 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 8, "5.dev2") +VERSION = (2, 8, "5.dev3") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 94c8ecc4..3e51f95b 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -113,10 +113,15 @@ def ProcessFlags(env, flags): for i, p in enumerate(env.get("CPPPATH", [])): if isdir(p): env['CPPPATH'][i] = realpath(p) + # fix relative path for "-include" + for i, f in enumerate(env.get("CCFLAGS", [])): + if isinstance(f, tuple) and f[0] == "-include": + env['CCFLAGS'][i] = (f[0], env.File(realpath(f[1].get_path()))) # Cancel any previous definition of name, either built in or # provided with a -D option // Issue #191 - undefines = [u for u in env.get("CCFLAGS", []) if u.startswith("-U")] + undefines = [u for u in env.get("CCFLAGS", []) + if isinstance(u, basestring) and u.startswith("-U")] if undefines: for undef in undefines: env['CCFLAGS'].remove(undef)