mirror of
https://github.com/platformio/platformio-core.git
synced 2025-08-02 19:34:27 +02:00
Fix an issue with incorrect order of project "include" and "src" paths in `CPPPATH
` // Resolve #1914
This commit is contained in:
@@ -22,6 +22,8 @@ PlatformIO 3.0
|
|||||||
(`issue #2164 <https://github.com/platformio/platformio-core/issues/2164>`_)
|
(`issue #2164 <https://github.com/platformio/platformio-core/issues/2164>`_)
|
||||||
* Fixed an error with conflicting declaration of a prototype (Arduino sketch preprocessor)
|
* 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 "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)
|
3.6.5 (2019-03-07)
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
@@ -179,10 +179,11 @@ class LibBuilderBase(object):
|
|||||||
if isdir(join(self.path, "src")) else self.path)
|
if isdir(join(self.path, "src")) else self.path)
|
||||||
|
|
||||||
def get_include_dirs(self):
|
def get_include_dirs(self):
|
||||||
items = [self.src_dir]
|
items = []
|
||||||
include_dir = self.include_dir
|
include_dir = self.include_dir
|
||||||
if include_dir and include_dir not in items:
|
if include_dir and include_dir not in items:
|
||||||
items.append(include_dir)
|
items.append(include_dir)
|
||||||
|
items.append(self.src_dir)
|
||||||
return items
|
return items
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -759,10 +760,11 @@ class ProjectAsLibBuilder(LibBuilderBase):
|
|||||||
return self.env.subst("$PROJECTSRC_DIR")
|
return self.env.subst("$PROJECTSRC_DIR")
|
||||||
|
|
||||||
def get_include_dirs(self):
|
def get_include_dirs(self):
|
||||||
include_dirs = LibBuilderBase.get_include_dirs(self)
|
include_dirs = []
|
||||||
project_include_dir = self.env.subst("$PROJECTINCLUDE_DIR")
|
project_include_dir = self.env.subst("$PROJECTINCLUDE_DIR")
|
||||||
if isdir(project_include_dir):
|
if isdir(project_include_dir):
|
||||||
include_dirs.append(project_include_dir)
|
include_dirs.append(project_include_dir)
|
||||||
|
include_dirs.extend(LibBuilderBase.get_include_dirs(self))
|
||||||
return include_dirs
|
return include_dirs
|
||||||
|
|
||||||
def get_search_files(self):
|
def get_search_files(self):
|
||||||
@@ -830,8 +832,9 @@ class ProjectAsLibBuilder(LibBuilderBase):
|
|||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
self._is_built = True # do not build Project now
|
self._is_built = True # do not build Project now
|
||||||
|
result = LibBuilderBase.build(self)
|
||||||
self.env.PrependUnique(CPPPATH=self.get_include_dirs())
|
self.env.PrependUnique(CPPPATH=self.get_include_dirs())
|
||||||
return LibBuilderBase.build(self)
|
return result
|
||||||
|
|
||||||
|
|
||||||
def GetLibBuilders(env): # pylint: disable=too-many-branches
|
def GetLibBuilders(env): # pylint: disable=too-many-branches
|
||||||
|
Reference in New Issue
Block a user