Fix an issue when dynamic build flags were not handled correctly // Resolve #1799

This commit is contained in:
Ivan Kravets
2018-10-12 15:09:54 +03:00
parent 13ff30788e
commit 00b173f13f
2 changed files with 10 additions and 3 deletions

View File

@ -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) <https://docs.platformio.org/page/projectconf.html>`__
* 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 <https://github.com/platformio/platformio-core/issues/1799>`_)
3.6.0 (2018-08-06)
~~~~~~~~~~~~~~~~~~

View File

@ -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']: