Fix LDF C/C++ Preprocessor for conditional syntax // Resolve #837

This commit is contained in:
Ivan Kravets
2016-11-28 23:24:21 +02:00
parent 2ac00fb4b1
commit 8b121a1ccb
4 changed files with 18 additions and 13 deletions

View File

@ -31,7 +31,8 @@ PlatformIO 3.0
* Improved handling of library dependencies specified in ``library.json`` manifest
(`issue #814 <https://github.com/platformio/platformio/issues/814>`_)
* Improved `Library Dependency Finder (LDF) <http://docs.platformio.org/en/stable/librarymanager/ldf.html>`__
for circular dependencies
for circular dependencies and fixed LDF C/C++ Preprocessor for conditional syntax
(`issue #837 <https://github.com/platformio/platformio/issues/837>`_)
* Fixed issue with ``PATH`` auto-configuring for upload tools
* Fixed ``99-platformio-udev.rules`` checker for Linux OS

View File

@ -13,6 +13,7 @@
# limitations under the License.
# pylint: disable=no-member, no-self-use, unused-argument
# pylint: disable=too-many-instance-attributes, too-many-public-methods
from __future__ import absolute_import
@ -76,12 +77,11 @@ class LibBuilderFactory(object):
return []
# pylint: disable=too-many-instance-attributes, too-many-public-methods
class LibBuilderBase(object):
INC_SCANNER = SCons.Scanner.C.CScanner()
CLASSIC_SCANNER = SCons.Scanner.C.CScanner()
INTELLISENSE_SCANNER = SCons.Scanner.C.SConsCPPScannerWrapper("CScanner",
"CPPPATH")
INC_DIRS_CACHE = None
def __init__(self, env, path, manifest=None, verbose=False):
@ -280,8 +280,16 @@ class LibBuilderBase(object):
result = []
for path in self._validate_search_paths(search_paths):
for inc in self.env.File(path).get_found_includes(
self.env, LibBuilderBase.INC_SCANNER, tuple(inc_dirs)):
try:
assert isinstance(self, ProjectAsLibBuilder) or \
self.lib_ldf_mode == 2
incs = self.env.File(path).get_found_includes(
self.env, LibBuilderBase.INTELLISENSE_SCANNER,
tuple(inc_dirs))
except: # pylint: disable=bare-except
incs = self.env.File(path).get_found_includes(
self.env, LibBuilderBase.CLASSIC_SCANNER, tuple(inc_dirs))
for inc in incs:
if inc not in result:
result.append(inc)
return result

View File

@ -47,10 +47,7 @@ def remote_agent():
"--working-dir",
envvar="PLATFORMIO_REMOTE_AGENT_DIR",
type=click.Path(
file_okay=False,
dir_okay=True,
writable=True,
resolve_path=True))
file_okay=False, dir_okay=True, writable=True, resolve_path=True))
def remote_agent_start(**kwargs):
pioplus_call(sys.argv[1:])

View File

@ -477,8 +477,7 @@ class PlatformBase(PlatformPackagesMixin, PlatformRunMixin):
}
if "tool-scons" not in self.packages:
self.packages['tool-scons'] = {
"version": self._manifest.get("engines", {}).get(
"scons", ">=2.3.0,<2.6.0"),
"version": "~3.20401.1",
"optional": False
}