diff options
author | Greg Becker <becker33@llnl.gov> | 2020-11-11 08:54:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-11 10:54:24 -0600 |
commit | 229fc11fdb2ced2820e104b47beb55f52408f914 (patch) | |
tree | 717a7cb9ad7bf0a7a0f31255756353a874314775 /var | |
parent | 2c55d47c1ed9c78eb53bc1ba459a2e88b821105c (diff) | |
download | spack-229fc11fdb2ced2820e104b47beb55f52408f914.tar.gz spack-229fc11fdb2ced2820e104b47beb55f52408f914.tar.bz2 spack-229fc11fdb2ced2820e104b47beb55f52408f914.tar.xz spack-229fc11fdb2ced2820e104b47beb55f52408f914.zip |
axom: devtools require llvm clang-format (#19740)
* follow-up to previous PR
* build type
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/axom/package.py | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/var/spack/repos/builtin/packages/axom/package.py b/var/spack/repos/builtin/packages/axom/package.py index 48434b4bd3..3a0fa3a736 100644 --- a/var/spack/repos/builtin/packages/axom/package.py +++ b/var/spack/repos/builtin/packages/axom/package.py @@ -137,6 +137,7 @@ class Axom(CMakePackage, CudaPackage): depends_on("python", when="+devtools") depends_on("py-sphinx", when="+devtools") depends_on("py-shroud", when="+devtools") + depends_on("llvm+clang@10.0.0", when="+devtools", type='build') def flag_handler(self, name, flags): if name in ('cflags', 'cxxflags', 'fflags'): @@ -422,22 +423,9 @@ class Axom(CMakePackage, CudaPackage): # Only turn on clangformat support if devtools is on if "+devtools" in spec: - cf_paths = [] - lc_clangpath = "/usr/tce/packages/clang/clang-10.0.0" - cf_paths.append(pjoin(lc_clangpath, "bin/clang-format")) - cf_paths.append("/usr/bin/clang-format-10") - cf_paths.append("/usr/bin/clang-format") - - cf_found = False - for path in cf_paths: - if os.path.exists(path): - cf_found = True - cfg.write(cmake_cache_entry("CLANGFORMAT_EXECUTABLE", - path)) - - if not cf_found: - cfg.write("# Unable to find clang-format\n\n") - cfg.write(cmake_cache_option("ENABLE_CLANGFORMAT", False)) + clang_fmt_path = spec['llvm'].prefix.bin.join('clang-format') + cfg.write(cmake_cache_entry("CLANGFORMAT_EXECUTABLE", + clang_fmt_path)) else: cfg.write("# ClangFormat disabled due to disabled devtools\n") cfg.write(cmake_cache_option("ENABLE_CLANGFORMAT", False)) |