Skip to content

Commit

Permalink
scons: pass -isystem instead of -I for third party library includes
Browse files Browse the repository at this point in the history
  • Loading branch information
loonycyborg committed Jan 4, 2016
1 parent a5ba327 commit a48be10
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions SConstruct
Expand Up @@ -159,6 +159,8 @@ else:
from cross_compile import *
setup_cross_compile(env)

env.Tool("system_include")

if 'HOME' in os.environ:
env['ENV']['HOME'] = os.environ['HOME']

Expand Down
20 changes: 20 additions & 0 deletions scons/system_include.py
@@ -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)} $)"

0 comments on commit a48be10

Please sign in to comment.