Skip to content

Commit f1a4946

Browse files
committed
Updated platform on linux-gcc to include compiler version (necessary for multiple targets built in same directory, and not a bad idea for other builds).
1 parent 02c7fe7 commit f1a4946

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

SConstruct

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ options.Add( EnumOption('platform',
1414

1515
try:
1616
platform = ARGUMENTS['platform']
17+
if platform == 'linux-gcc':
18+
CXX = 'g++' # not quite right, but env is not yet available.
19+
import commands
20+
version = commands.getoutput('%s -dumpversion' %CXX)
21+
platform = 'linux-gcc-%s' %version
22+
print "Using platform '%s'" %platform
23+
LD_LIBRARY_PATH = os.environ.get('LD_LIBRARY_PATH', '')
24+
LD_LIBRARY_PATH = "%s:libs/%s" %(LD_LIBRARY_PATH, platform)
25+
os.environ['LD_LIBRARY_PATH'] = LD_LIBRARY_PATH
26+
print "LD_LIBRARY_PATH =", LD_LIBRARY_PATH
1727
except KeyError:
1828
print 'You must specify a "platform"'
1929
sys.exit(2)
@@ -74,11 +84,9 @@ elif platform == 'msvc80':
7484
elif platform == 'mingw':
7585
env.Tool( 'mingw' )
7686
env.Append( CPPDEFINES=[ "WIN32", "NDEBUG", "_MT" ] )
77-
elif platform == 'linux-gcc':
87+
elif platform.startswith('linux-gcc'):
7888
env.Tool( 'default' )
7989
env.Append( LIBS = ['pthread'], CCFLAGS = "-Wall" )
80-
LD_LIBRARY_PATH = os.environ.get('LD_LIBRARY_PATH', '')
81-
os.environ['LD_LIBRARY_PATH'] = "%s:libs/linux-gcc" %LD_LIBRARY_PATH
8290
else:
8391
print "UNSUPPORTED PLATFORM."
8492
env.Exit(1)
@@ -174,3 +182,9 @@ env.Alias( 'src-dist', srcdist_cmd )
174182
buildProjectInDirectory( 'src/jsontestrunner' )
175183
buildProjectInDirectory( 'src/lib_json' )
176184
buildProjectInDirectory( 'doc' )
185+
186+
# libs was happening before bin by chance, I think. When I added
187+
# the compiler version to linux-gcc, the order changed. This
188+
# fixes it (I believe).
189+
env.Depends('bin', 'libs')
190+
env.Depends('check', 'bin')

0 commit comments

Comments
 (0)