Get llvm version as a string. It may contain 'svn' postfix.
This commit is contained in:
parent
3d66981cc1
commit
7e7b362e47
1 changed files with 3 additions and 8 deletions
11
setup.py
11
setup.py
|
|
@ -38,12 +38,7 @@ def get_enabled_components():
|
||||||
return run_llvm_config(['--components']).split()
|
return run_llvm_config(['--components']).split()
|
||||||
|
|
||||||
def get_llvm_version():
|
def get_llvm_version():
|
||||||
# get version number; treat it as fixed point
|
return run_llvm_config([' --version'])
|
||||||
pat = re.compile(r'(\d+)\.(\d+)')
|
|
||||||
m = pat.search(run_llvm_config([' --version']))
|
|
||||||
if m is None:
|
|
||||||
sys.exit('could not determine llvm version')
|
|
||||||
return tuple(map(int, m.groups()))
|
|
||||||
|
|
||||||
|
|
||||||
def auto_intrinsic_gen(incdir):
|
def auto_intrinsic_gen(incdir):
|
||||||
|
|
@ -60,14 +55,14 @@ libdir = run_llvm_config(['--libdir'])
|
||||||
ldflags = run_llvm_config(['--ldflags'])
|
ldflags = run_llvm_config(['--ldflags'])
|
||||||
|
|
||||||
llvm_version = get_llvm_version()
|
llvm_version = get_llvm_version()
|
||||||
print('LLVM version = %d.%d' % llvm_version)
|
print('LLVM version = %s' % llvm_version)
|
||||||
|
|
||||||
auto_intrinsic_gen(incdir)
|
auto_intrinsic_gen(incdir)
|
||||||
|
|
||||||
macros = [('__STDC_CONSTANT_MACROS', None),
|
macros = [('__STDC_CONSTANT_MACROS', None),
|
||||||
('__STDC_LIMIT_MACROS', None)]
|
('__STDC_LIMIT_MACROS', None)]
|
||||||
if dynlink:
|
if dynlink:
|
||||||
libs_core = ['LLVM-%d.%d' % llvm_version]
|
libs_core = ['LLVM-%s' % llvm_version]
|
||||||
objs_core = []
|
objs_core = []
|
||||||
else:
|
else:
|
||||||
enabled_components = set(get_enabled_components())
|
enabled_components = set(get_enabled_components())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue