summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth R. Johnson <johnsonsr@ornl.gov>2022-09-12 10:22:14 -0400
committerGitHub <noreply@github.com>2022-09-12 08:22:14 -0600
commitd4065e11c6a6592d1ac8638cc4423695e37fbbde (patch)
tree6062917a3494433fee784593539e1d732a1dcf37
parentbb6c39ea7c14bd55f8ec2e971ebc6d6ce9324282 (diff)
downloadspack-d4065e11c6a6592d1ac8638cc4423695e37fbbde.tar.gz
spack-d4065e11c6a6592d1ac8638cc4423695e37fbbde.tar.bz2
spack-d4065e11c6a6592d1ac8638cc4423695e37fbbde.tar.xz
spack-d4065e11c6a6592d1ac8638cc4423695e37fbbde.zip
iwyu: support external find (#32458)
-rw-r--r--var/spack/repos/builtin/packages/iwyu/package.py12
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)]