diff --git a/HISTORY.rst b/HISTORY.rst index 44c43bb7..7280d349 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -15,6 +15,8 @@ PlatformIO 3.0 * Support in-line comments for multi-line value (``lib_deps``, ``build_flags``, etc) in `“platformio.ini” (Project Configuration File) `__ * Do not re-create ".gitignore" and ".travis.yml" files if they were removed from a project +* Fixed an issue when dynamic build flags were not handled correctly + (`issue #1799 `_) 3.6.0 (2018-08-06) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 9346f235..27726756 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -142,9 +142,14 @@ def BuildProgram(env): def ParseFlagsExtended(env, flags): - if isinstance(flags, list): - flags = " ".join(flags) - result = env.ParseFlags(str(flags)) + if not isinstance(flags, list): + flags = [flags] + result = {} + for raw in flags: + for key, value in env.ParseFlags(str(raw)).items(): + if key not in result: + result[key] = [] + result[key].extend(value) cppdefines = [] for item in result['CPPDEFINES']: