Improve removing of default build flags using build_unflags option // Resolve #1712

This commit is contained in:
Ivan Kravets
2018-06-30 19:34:24 +03:00
parent 357e70e5bb
commit 4adc73ebe2
2 changed files with 14 additions and 1 deletions

View File

@ -7,6 +7,8 @@ PlatformIO 3.0
3.5.4 (2018-??-??)
~~~~~~~~~~~~~~~~~~
* Improved removing of default build flags using `build_unflags <http://docs.platformio.org/page/projectconf/section_env_build.html#build-unflags>`__ option
(`issue #1712 <https://github.com/platformio/platformio-core/issues/1712>`_)
* Export ``LIBS``, ``LIBPATH``, and ``LINKFLAGS`` data from project dependent
libraries to the global build environment
* Don't export ``CPPPATH`` data of project dependent libraries to framework's

View File

@ -190,7 +190,18 @@ def ProcessFlags(env, flags): # pylint: disable=too-many-branches
def ProcessUnFlags(env, flags):
if not flags:
return
for key, unflags in env.ParseFlagsExtended(flags).items():
parsed = env.ParseFlagsExtended(flags)
# get all flags and copy them to each "*FLAGS" variable
all_flags = []
for key, unflags in parsed.items():
if key.endswith("FLAGS"):
all_flags.extend(unflags)
for key, unflags in parsed.items():
if key.endswith("FLAGS"):
parsed[key].extend(all_flags)
for key, unflags in parsed.items():
for unflag in unflags:
for current in env.get(key, []):
conditions = [