mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Fix an issue with incorrect order of project "include" and "src" paths in `CPPPATH
` // Resolve #1914
This commit is contained in:
@ -13,6 +13,8 @@ PlatformIO 3.0
|
||||
(`issue #2164 <https://github.com/platformio/platformio-core/issues/2164>`_)
|
||||
* Fixed an error with conflicting declaration of a prototype (Arduino sketch preprocessor)
|
||||
* Fixed "FileExistsError" when `platformio ci <https://docs.platformio.org/en/latest/userguide/cmd_ci.html>`__ command is used in pair with ``--keep-build-dir`` option
|
||||
* Fixed an issue with incorrect order of project "include" and "src" paths in ``CPPPATH``
|
||||
(`issue #1914 <https://github.com/platformio/platformio-core/issues/1914>`_)
|
||||
|
||||
3.6.5 (2019-03-07)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
@ -177,10 +177,11 @@ class LibBuilderBase(object):
|
||||
if isdir(join(self.path, "src")) else self.path)
|
||||
|
||||
def get_include_dirs(self):
|
||||
items = [self.src_dir]
|
||||
items = []
|
||||
include_dir = self.include_dir
|
||||
if include_dir and include_dir not in items:
|
||||
items.append(include_dir)
|
||||
items.append(self.src_dir)
|
||||
return items
|
||||
|
||||
@property
|
||||
@ -756,10 +757,11 @@ class ProjectAsLibBuilder(LibBuilderBase):
|
||||
return self.env.subst("$PROJECTSRC_DIR")
|
||||
|
||||
def get_include_dirs(self):
|
||||
include_dirs = LibBuilderBase.get_include_dirs(self)
|
||||
include_dirs = []
|
||||
project_include_dir = self.env.subst("$PROJECTINCLUDE_DIR")
|
||||
if isdir(project_include_dir):
|
||||
include_dirs.append(project_include_dir)
|
||||
include_dirs.extend(LibBuilderBase.get_include_dirs(self))
|
||||
return include_dirs
|
||||
|
||||
def get_search_files(self):
|
||||
@ -827,8 +829,9 @@ class ProjectAsLibBuilder(LibBuilderBase):
|
||||
|
||||
def build(self):
|
||||
self._is_built = True # do not build Project now
|
||||
result = LibBuilderBase.build(self)
|
||||
self.env.PrependUnique(CPPPATH=self.get_include_dirs())
|
||||
return LibBuilderBase.build(self)
|
||||
return result
|
||||
|
||||
|
||||
def GetLibBuilders(env): # pylint: disable=too-many-branches
|
||||
|
Reference in New Issue
Block a user