at v192 36 lines 1.3 kB view raw
1{ stdenv, fetchurl, cmake, llvmPackages_36 }: 2 3let 4 version = "0.4"; 5 llvmPackages = llvmPackages_36; 6in stdenv.mkDerivation rec { 7 name = "include-what-you-use-${version}"; 8 9 src = fetchurl { 10 sha256 = "19pwhgwvfr86n8ks099p9r02v7zh8d3qs7g7snzkhpdgq1azww85"; 11 url = "${meta.homepage}/downloads/${name}.src.tar.gz"; 12 }; 13 14 meta = with stdenv.lib; { 15 description = "Analyze #includes in C/C++ source files with clang"; 16 longDescription = '' 17 For every symbol (type, function variable, or macro) that you use in 18 foo.cc, either foo.cc or foo.h should #include a .h file that exports the 19 declaration of that symbol. The main goal of include-what-you-use is to 20 remove superfluous #includes, both by figuring out what #includes are not 21 actually needed for this file (for both .cc and .h files), and by 22 replacing #includes with forward-declares when possible. 23 ''; 24 homepage = http://include-what-you-use.org; 25 license = licenses.bsd3; 26 platforms = with platforms; linux; 27 maintainers = with maintainers; [ nckx ]; 28 }; 29 30 buildInputs = with llvmPackages; [ clang llvm ]; 31 nativeBuildInputs = [ cmake ]; 32 33 cmakeFlags = "-DIWYU_LLVM_ROOT_PATH=${llvmPackages.clang-unwrapped}"; 34 35 enableParallelBuilding = true; 36}