diff options
author | Harmen Stoppels <harmenstoppels@gmail.com> | 2022-05-25 15:24:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-25 06:24:38 -0700 |
commit | aba9149b716bf0216281bb485bf9e71a9b49c9f8 (patch) | |
tree | b5f4f11e72380b996b6ff535ae0470e70cd5225a /var | |
parent | b29f27aec7ac6ad05c3f45972c97b1309d4936af (diff) | |
download | spack-aba9149b716bf0216281bb485bf9e71a9b49c9f8.tar.gz spack-aba9149b716bf0216281bb485bf9e71a9b49c9f8.tar.bz2 spack-aba9149b716bf0216281bb485bf9e71a9b49c9f8.tar.xz spack-aba9149b716bf0216281bb485bf9e71a9b49c9f8.zip |
p7zip: fix %clang (#30843)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/p7zip/package.py | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/p7zip/package.py b/var/spack/repos/builtin/packages/p7zip/package.py index 9f4384a08d..fdf5b4a08b 100644 --- a/var/spack/repos/builtin/packages/p7zip/package.py +++ b/var/spack/repos/builtin/packages/p7zip/package.py @@ -23,12 +23,23 @@ class P7zip(MakefilePackage): # all3 includes 7z, 7za, and 7zr build_targets = ['all3'] + depends_on('yasm', type='build', when='%clang') + def edit(self, spec, prefix): - if 'platform=darwin' in self.spec: - if '%gcc' in self.spec: - copy('makefile.macosx_gcc_64bits', 'makefile.machine') - elif '%apple-clang' in self.spec or '%clang' in self.spec: - copy('makefile.macosx_llvm_64bits', 'makefile.machine') + # Use the suggested makefile + for tgt, makefile in { + 'platform=linux %clang': 'makefile.linux_clang_amd64_asm', + 'platform=darwin %gcc': 'makefile.macosx_gcc_64bits', + 'platform=darwin %apple-clang': 'makefile.macosx_llvm_64bits', + 'platform=darwin %clang': 'makefile.macosx_llvm_64bits', + }.items(): + if tgt in self.spec: + copy(makefile, 'makefile.machine') + break + # Silence an error about -Wc++11-narrowing in clang. + if '@16.02 %clang' in spec: + with open('makefile.machine', 'a') as f: + f.write("ALLFLAGS += -Wno-c++11-narrowing") @property def install_targets(self): |