clingo-bootstrap: add a variant for static libstdc++ (#26421)
This commit is contained in:
parent
b3d3ce1c37
commit
0e469fc01e
@ -14,6 +14,9 @@ class ClingoBootstrap(Clingo):
|
|||||||
variant('build_type', default='Release', values=('Release',),
|
variant('build_type', default='Release', values=('Release',),
|
||||||
description='CMake build type')
|
description='CMake build type')
|
||||||
|
|
||||||
|
variant('static_libstdcpp', default=False,
|
||||||
|
description='Require a static version of libstdc++')
|
||||||
|
|
||||||
# CMake at version 3.16.0 or higher has the possibility to force the
|
# CMake at version 3.16.0 or higher has the possibility to force the
|
||||||
# Python interpreter, which is crucial to build against external Python
|
# Python interpreter, which is crucial to build against external Python
|
||||||
# in environment where more than one interpreter is in the same prefix
|
# in environment where more than one interpreter is in the same prefix
|
||||||
@ -56,14 +59,17 @@ def cmake_args(self):
|
|||||||
return args
|
return args
|
||||||
|
|
||||||
def setup_build_environment(self, env):
|
def setup_build_environment(self, env):
|
||||||
|
opts = None
|
||||||
if '%apple-clang platform=darwin' in self.spec:
|
if '%apple-clang platform=darwin' in self.spec:
|
||||||
opts = '-mmacosx-version-min=10.13'
|
opts = '-mmacosx-version-min=10.13'
|
||||||
elif '%gcc' in self.spec:
|
elif '%gcc' in self.spec:
|
||||||
|
if '+static_libstdcpp' in self.spec:
|
||||||
# This is either linux or cray
|
# This is either linux or cray
|
||||||
opts = '-static-libstdc++ -static-libgcc -Wl,--exclude-libs,ALL'
|
opts = '-static-libstdc++ -static-libgcc -Wl,--exclude-libs,ALL'
|
||||||
else:
|
else:
|
||||||
msg = 'unexpected compiler for spec "{0}"'.format(self.spec)
|
msg = 'unexpected compiler for spec "{0}"'.format(self.spec)
|
||||||
raise RuntimeError(msg)
|
raise RuntimeError(msg)
|
||||||
|
|
||||||
|
if opts:
|
||||||
env.set('CXXFLAGS', opts)
|
env.set('CXXFLAGS', opts)
|
||||||
env.set('LDFLAGS', opts)
|
env.set('LDFLAGS', opts)
|
||||||
|
Loading…
Reference in New Issue
Block a user