Commit 0bee0555 authored by Marcel Huber's avatar Marcel Huber
Browse files

ignoring 3rdparty files from being put into the compilation database

parent df64c0be
......@@ -53,6 +53,8 @@ if SCons.Util.case_sensitive_suffixes(".c", ".C"):
_configure_tmpfile_re = re.compile(r'conftest_\d+\.c')
_third_party_prefix = None
# We make no effort to avoid rebuilding the entries. Someday, perhaps we could and even
# integrate with the cache, but there doesn't seem to be much call for it.
......@@ -90,6 +92,8 @@ def makeEmitCompilationDbEntry(comstr):
if _configure_tmpfile_re.match(source[0].name):
return target, source
if _third_party_prefix and source[0].path.find(_third_party_prefix) >= 0:
return target, source
dbtarget = __CompilationDbNode(source)
......@@ -158,6 +162,8 @@ def ScanCompilationDb(node, env, path):
def generate(env, **kwargs):
from SCons.Script import GetOption
static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
env["COMPILATIONDB_COMSTR"] = kwargs.get("COMPILATIONDB_COMSTR", "Building compilation database $TARGET")
......@@ -198,6 +204,12 @@ def generate(env, **kwargs):
target_scanner=SCons.Scanner.Scanner(function=ScanCompilationDb, node_class=None),
global _third_party_prefix
_third_party_prefix = str(GetOption('3rdparty-build-prefix'))
except AttributeError:
def CompilationDatabase(env, target):
result = env.__COMPILATIONDB_Database(target=target, source=[])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment