diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/iwyu/package.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/iwyu/package.py b/var/spack/repos/builtin/packages/iwyu/package.py index 5325563ee1..acd0ffea44 100644 --- a/var/spack/repos/builtin/packages/iwyu/package.py +++ b/var/spack/repos/builtin/packages/iwyu/package.py @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import re + import archspec from spack.package import * @@ -18,6 +20,10 @@ class Iwyu(CMakePackage): maintainers = ["sethrj"] + tags = ["build-tools"] + + executables = ["^include-what-you-use$"] + version("0.18", sha256="9102fc8419294757df86a89ce6ec305f8d90a818d1f2598a139d15eb1894b8f3") version("0.17", sha256="eca7c04f8b416b6385ed00e33669a7fa4693cd26cb72b522cde558828eb0c665") version("0.16", sha256="8d6fc9b255343bc1e5ec459e39512df1d51c60e03562985e0076036119ff5a1c") @@ -43,6 +49,12 @@ class Iwyu(CMakePackage): for _arch in _arches - set(["x86", "x86_64"]): depends_on("llvm targets=x86", when="arch={0}:".format(_arch)) + @classmethod + def determine_version(cls, exe): + output = Executable(exe)("--version", output=str, error=str) + match = re.search(r"include-what-you-use\s+(\S+)", output) + return match.group(1) if match else None + @when("@0.14:") def cmake_args(self): return [self.define("CMAKE_CXX_STANDARD", 14), self.define("CMAKE_CXX_EXTENSIONS", False)] |