mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 19:58:09 +02:00
scons: Don't set LLVM_VERSION if one of the llvm-config calls fails.
Ubuntu 8.10 has llvm-config version 2.2, which doesn't have nativecodegen. This triggers an exception.
This commit is contained in:
parent
b481fb2c6d
commit
79f48c9f9e
2 changed files with 11 additions and 9 deletions
|
|
@ -56,15 +56,17 @@ def generate(env):
|
|||
env.PrependENVPath('PATH', llvm_bin_dir)
|
||||
|
||||
if env.Detect('llvm-config'):
|
||||
try:
|
||||
env['LLVM_VERSION'] = env.backtick('llvm-config --version')
|
||||
except AttributeError:
|
||||
env['LLVM_VERSION'] = 'X.X'
|
||||
version = env.backtick('llvm-config --version').rstrip()
|
||||
|
||||
env.ParseConfig('llvm-config --cppflags')
|
||||
env.ParseConfig('llvm-config --libs jit interpreter nativecodegen bitwriter')
|
||||
env.ParseConfig('llvm-config --ldflags')
|
||||
env['LINK'] = env['CXX']
|
||||
try:
|
||||
env.ParseConfig('llvm-config --cppflags')
|
||||
env.ParseConfig('llvm-config --libs jit interpreter nativecodegen bitwriter')
|
||||
env.ParseConfig('llvm-config --ldflags')
|
||||
except OSError:
|
||||
print 'llvm-config version %s failed' % version
|
||||
else:
|
||||
env['LINK'] = env['CXX']
|
||||
env['LLVM_VERSION'] = version
|
||||
|
||||
def exists(env):
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ Import('*')
|
|||
env = env.Clone()
|
||||
|
||||
env.Tool('llvm')
|
||||
if 'LLVM_VERSION' not in env:
|
||||
if env.has_key('LLVM_VERSION') is False:
|
||||
print 'warning: LLVM not found: not building llvmpipe'
|
||||
Return()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue