diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2021-10-02 14:53:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-02 14:53:24 +0200 |
commit | 0e469fc01e3d3fb7a9a2cfffa97ef017ac9292e7 (patch) | |
tree | 725657d4759713b526ed23df3806ef31b6952375 | |
parent | b3d3ce1c3777a33c450cf1b06c52295ff7e86140 (diff) | |
download | spack-0e469fc01e3d3fb7a9a2cfffa97ef017ac9292e7.tar.gz spack-0e469fc01e3d3fb7a9a2cfffa97ef017ac9292e7.tar.bz2 spack-0e469fc01e3d3fb7a9a2cfffa97ef017ac9292e7.tar.xz spack-0e469fc01e3d3fb7a9a2cfffa97ef017ac9292e7.zip |
clingo-bootstrap: add a variant for static libstdc++ (#26421)
-rw-r--r-- | var/spack/repos/builtin/packages/clingo-bootstrap/package.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/clingo-bootstrap/package.py b/var/spack/repos/builtin/packages/clingo-bootstrap/package.py index fcb96fa1d8..657e25ab80 100644 --- a/var/spack/repos/builtin/packages/clingo-bootstrap/package.py +++ b/var/spack/repos/builtin/packages/clingo-bootstrap/package.py @@ -14,6 +14,9 @@ class ClingoBootstrap(Clingo): variant('build_type', default='Release', values=('Release',), 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 # Python interpreter, which is crucial to build against external Python # in environment where more than one interpreter is in the same prefix @@ -56,14 +59,17 @@ class ClingoBootstrap(Clingo): return args def setup_build_environment(self, env): + opts = None if '%apple-clang platform=darwin' in self.spec: opts = '-mmacosx-version-min=10.13' elif '%gcc' in self.spec: - # This is either linux or cray - opts = '-static-libstdc++ -static-libgcc -Wl,--exclude-libs,ALL' + if '+static_libstdcpp' in self.spec: + # This is either linux or cray + opts = '-static-libstdc++ -static-libgcc -Wl,--exclude-libs,ALL' else: msg = 'unexpected compiler for spec "{0}"'.format(self.spec) raise RuntimeError(msg) - env.set('CXXFLAGS', opts) - env.set('LDFLAGS', opts) + if opts: + env.set('CXXFLAGS', opts) + env.set('LDFLAGS', opts) |