mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Issue #4762 separated out the optional addition of toolchains to compiledb include paths and added a call to it in the library building step for user defined libraries, allowing the automatic inclusion of toolchains in private lib compiledb generation
This commit is contained in:
@ -126,6 +126,12 @@ def ProcessProgramDeps(env):
|
|||||||
# remove specified flags
|
# remove specified flags
|
||||||
env.ProcessUnFlags(env.get("BUILD_UNFLAGS"))
|
env.ProcessUnFlags(env.get("BUILD_UNFLAGS"))
|
||||||
|
|
||||||
|
env.ProcessCompileDbToolchainOption()
|
||||||
|
|
||||||
|
|
||||||
|
def ProcessCompileDbToolchainOption(
|
||||||
|
env,
|
||||||
|
): # separated out to selectively add to lib build step
|
||||||
if "compiledb" in COMMAND_LINE_TARGETS:
|
if "compiledb" in COMMAND_LINE_TARGETS:
|
||||||
# Resolve absolute path of toolchain
|
# Resolve absolute path of toolchain
|
||||||
for cmd in ("CC", "CXX", "AS"):
|
for cmd in ("CC", "CXX", "AS"):
|
||||||
@ -138,6 +144,7 @@ def ProcessProgramDeps(env):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if env.get("COMPILATIONDB_INCLUDE_TOOLCHAIN"):
|
if env.get("COMPILATIONDB_INCLUDE_TOOLCHAIN"):
|
||||||
|
print("Warning! `COMPILATIONDB_INCLUDE_TOOLCHAIN` is scoping")
|
||||||
for scope, includes in env.DumpIntegrationIncludes().items():
|
for scope, includes in env.DumpIntegrationIncludes().items():
|
||||||
if scope in ("toolchain",):
|
if scope in ("toolchain",):
|
||||||
env.Append(CPPPATH=includes)
|
env.Append(CPPPATH=includes)
|
||||||
@ -376,6 +383,7 @@ def generate(env):
|
|||||||
env.AddMethod(GetBuildType)
|
env.AddMethod(GetBuildType)
|
||||||
env.AddMethod(BuildProgram)
|
env.AddMethod(BuildProgram)
|
||||||
env.AddMethod(ProcessProgramDeps)
|
env.AddMethod(ProcessProgramDeps)
|
||||||
|
env.AddMethod(ProcessCompileDbToolchainOption)
|
||||||
env.AddMethod(ProcessProjectDeps)
|
env.AddMethod(ProcessProjectDeps)
|
||||||
env.AddMethod(ParseFlagsExtended)
|
env.AddMethod(ParseFlagsExtended)
|
||||||
env.AddMethod(ProcessFlags)
|
env.AddMethod(ProcessFlags)
|
||||||
|
@ -478,6 +478,8 @@ class LibBuilderBase:
|
|||||||
|
|
||||||
self.env.PrependUnique(CPPPATH=self.get_include_dirs())
|
self.env.PrependUnique(CPPPATH=self.get_include_dirs())
|
||||||
|
|
||||||
|
self.env.ProcessCompileDbToolchainOption()
|
||||||
|
|
||||||
if self.lib_ldf_mode == "off":
|
if self.lib_ldf_mode == "off":
|
||||||
for lb in self.env.GetLibBuilders():
|
for lb in self.env.GetLibBuilders():
|
||||||
if self == lb or not lb.is_built:
|
if self == lb or not lb.is_built:
|
||||||
|
Reference in New Issue
Block a user