summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorSeth R. Johnson <johnsonsr@ornl.gov>2020-03-26 23:38:56 -0400
committerGitHub <noreply@github.com>2020-03-26 22:38:56 -0500
commite989c05cd0e249be41cd7a4a24f2b126c3ce6f8d (patch)
treeda130548d7dd70e191e5fe073bbe4e5f150058e1 /var
parent209c7e3ddd4e0883c4c17515c801b78032059abe (diff)
downloadspack-e989c05cd0e249be41cd7a4a24f2b126c3ce6f8d.tar.gz
spack-e989c05cd0e249be41cd7a4a24f2b126c3ce6f8d.tar.bz2
spack-e989c05cd0e249be41cd7a4a24f2b126c3ce6f8d.tar.xz
spack-e989c05cd0e249be41cd7a4a24f2b126c3ce6f8d.zip
Add include-what-you-use (#15691)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/iwyu/iwyu-013-cmake.patch34
-rw-r--r--var/spack/repos/builtin/packages/iwyu/package.py27
2 files changed, 61 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/iwyu/iwyu-013-cmake.patch b/var/spack/repos/builtin/packages/iwyu/iwyu-013-cmake.patch
new file mode 100644
index 0000000000..78cb1a2d10
--- /dev/null
+++ b/var/spack/repos/builtin/packages/iwyu/iwyu-013-cmake.patch
@@ -0,0 +1,34 @@
+--- include-what-you-use/CMakeLists.txt 2019-10-24 15:47:52.000000000 -0400
++++ spack-src/CMakeLists.txt 2020-03-26 07:16:53.284593661 -0400
+@@ -60,21 +60,22 @@
+ # Use only major.minor.patch for the resource directory structure; some
+ # platforms include suffix in LLVM_VERSION.
+ set(llvm_ver ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH})
+- set(clang_headers_src ${CMAKE_PREFIX_PATH}/lib/clang/${llvm_ver}/include)
+- set(clang_headers_dst ${CMAKE_BINARY_DIR}/lib/clang/${llvm_ver}/include)
++ set(clang_headers_src "${LLVM_INSTALL_PREFIX}/lib/clang/${llvm_ver}/include")
++ set(clang_headers_dst "${CMAKE_BINARY_DIR}/lib/clang/${llvm_ver}/include")
+
+- file(GLOB_RECURSE in_files RELATIVE ${clang_headers_src} ${clang_headers_src}/*)
++ file(GLOB_RECURSE in_files RELATIVE "${clang_headers_src}"
++ "${clang_headers_src}/*")
+
+ set(out_files)
+ foreach (file ${in_files})
+- set(src ${clang_headers_src}/${file})
+- set(dst ${clang_headers_dst}/${file})
++ set(src "${clang_headers_src}/${file}")
++ set(dst "${clang_headers_dst}/${file}")
+
+- add_custom_command(OUTPUT ${dst}
+- DEPENDS ${src}
+- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
++ add_custom_command(OUTPUT "${dst}"
++ DEPENDS "${src}"
++ COMMAND ${CMAKE_COMMAND} -E copy_if_different "${src}" "${dst}"
+ COMMENT "Copying clang's ${file}...")
+- list(APPEND out_files ${dst})
++ list(APPEND out_files "${dst}")
+ endforeach()
+
+ add_custom_target(clang-resource-headers ALL DEPENDS ${out_files})
diff --git a/var/spack/repos/builtin/packages/iwyu/package.py b/var/spack/repos/builtin/packages/iwyu/package.py
new file mode 100644
index 0000000000..a05ff073b7
--- /dev/null
+++ b/var/spack/repos/builtin/packages/iwyu/package.py
@@ -0,0 +1,27 @@
+# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack import *
+
+
+class Iwyu(CMakePackage):
+ """include-what-you-use: A tool for use with clang to analyze #includes in
+ C and C++ source files
+ """
+
+ homepage = "https://include-what-you-use.org"
+ url = "https://include-what-you-use.org/downloads/include-what-you-use-0.13.src.tar.gz"
+
+ maintainers = ['sethrj']
+
+ version('0.13', sha256='49294270aa64e8c04182369212cd919f3b3e0e47601b1f935f038c761c265bc9')
+ version('0.12', sha256='a5892fb0abccb820c394e4e245c00ef30fc94e4ae58a048b23f94047c0816025')
+ version('0.11', sha256='2d2877726c4aed9518cbb37673ffbc2b7da9c239bf8fe29432da35c1c0ec367a')
+
+ patch('iwyu-013-cmake.patch', when='@0.13')
+
+ depends_on('llvm+clang@9.0:9.999', when='@0.13')
+ depends_on('llvm+clang@8.0:8.999', when='@0.12')
+ depends_on('llvm+clang@7.0:7.999', when='@0.11')