Skip to content

Commit

Permalink
Import compiler/linker flags from environment
Browse files Browse the repository at this point in the history
  • Loading branch information
mattthias committed Oct 3, 2014
1 parent 59eeef8 commit 4c5fe4c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions SConstruct
Expand Up @@ -4,6 +4,20 @@ env = Environment()

if ARGUMENTS.get('debian'):
env.Append(CPPDEFINES=['__Debian__'])
flags = ["CPPFLAGS", "CFLAGS", "CXXFLAGS"]
for flag in flags:
try:
env[flag] = os.environ[flag]
print "Imported \"%s\" from environment with value \"%s\"." % (flag, env[flag])
except:
print "No \"%s\" in environment found" % flag

# if LDFLAGS exists put them into scons LINKFLAGS
try:
env['LINKFLAGS'] = os.environ['LDFLAGS']
print "Imported \"LDFLAGS\" from environment as \"LINKFLAGS\" with value \"%s\"." % env['LINKFLAGS']
except:
print "No \"LDFLAGS\" in environment found."

if os.uname()[0] == 'Linux':
env.Append(CPPDEFINES=['_HAVE_NCURSES','_HAVE_NCURSES_COLOR'])
Expand Down

0 comments on commit 4c5fe4c

Please sign in to comment.