forked from platformio/platformio-core
Experimental support for parsing source file in pair with a header when they have the same name // Issue #1175
This commit is contained in:
@ -334,8 +334,20 @@ class LibBuilderBase(object):
|
|||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
"Warning! Classic Pre Processor is used for `%s`, "
|
"Warning! Classic Pre Processor is used for `%s`, "
|
||||||
"advanced has failed with `%s`\n" % (path, e))
|
"advanced has failed with `%s`\n" % (path, e))
|
||||||
incs = self.env.File(path).get_found_includes(
|
_incs = self.env.File(path).get_found_includes(
|
||||||
self.env, LibBuilderBase.CLASSIC_SCANNER, tuple(inc_dirs))
|
self.env, LibBuilderBase.CLASSIC_SCANNER, tuple(inc_dirs))
|
||||||
|
incs = []
|
||||||
|
for inc in _incs:
|
||||||
|
incs.append(inc)
|
||||||
|
_h_path = inc.get_abspath()
|
||||||
|
if not self.env.IsFileWithExt(_h_path,
|
||||||
|
piotool.SRC_HEADER_EXT):
|
||||||
|
continue
|
||||||
|
_f_part = _h_path[:_h_path.rindex(".")]
|
||||||
|
for ext in piotool.SRC_C_EXT:
|
||||||
|
if isfile("%s.%s" % (_f_part, ext)):
|
||||||
|
incs.append(
|
||||||
|
self.env.File("%s.%s" % (_f_part, ext)))
|
||||||
# print path, map(lambda n: n.get_abspath(), incs)
|
# print path, map(lambda n: n.get_abspath(), incs)
|
||||||
for inc in incs:
|
for inc in incs:
|
||||||
if inc not in result:
|
if inc not in result:
|
||||||
|
@ -27,8 +27,9 @@ from SCons.Util import case_sensitive_suffixes, is_Sequence
|
|||||||
|
|
||||||
from platformio.util import glob_escape, pioversion_to_intstr
|
from platformio.util import glob_escape, pioversion_to_intstr
|
||||||
|
|
||||||
SRC_BUILD_EXT = ["c", "cc", "cpp", "S", "spp", "SPP", "sx", "s", "asm", "ASM"]
|
|
||||||
SRC_HEADER_EXT = ["h", "hpp"]
|
SRC_HEADER_EXT = ["h", "hpp"]
|
||||||
|
SRC_C_EXT = ["c", "cc", "cpp"]
|
||||||
|
SRC_BUILD_EXT = SRC_C_EXT + ["S", "spp", "SPP", "sx", "s", "asm", "ASM"]
|
||||||
SRC_FILTER_DEFAULT = ["+<*>", "-<.git%s>" % sep, "-<svn%s>" % sep]
|
SRC_FILTER_DEFAULT = ["+<*>", "-<.git%s>" % sep, "-<svn%s>" % sep]
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user