Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scons: pass -isystem instead of -I for third party library includes
- Loading branch information
1 parent
a5ba327
commit a48be10
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
def exists(): | ||
return True | ||
|
||
def make_incflags(paths, RDirs): | ||
result = [] | ||
for path in paths: | ||
if not str(path).startswith("#"): | ||
for rdir in RDirs((path,)): | ||
result.append("-isystem") | ||
result.append(str(rdir)) | ||
else: | ||
for rdir in RDirs((path,)): | ||
result.append("-I" + str(rdir)) | ||
return result | ||
|
||
def generate(env): | ||
if "gcc" in env["TOOLS"]: | ||
env["make_incflags"] = make_incflags | ||
env["INCPREFIX"] = "" | ||
env["_CPPINCFLAGS"] = "$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, lambda x : make_incflags(x, RDirs), TARGET, SOURCE)} $)" |