[clang] 1bd70bc - [gn build] add scan-build target

Nico Weber via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 10 03:19:07 PDT 2020


Author: Nico Weber
Date: 2020-04-10T06:18:41-04:00
New Revision: 1bd70bcd50be3c55e714350e3aadfd48040581f1

URL: https://github.com/llvm/llvm-project/commit/1bd70bcd50be3c55e714350e3aadfd48040581f1
DIFF: https://github.com/llvm/llvm-project/commit/1bd70bcd50be3c55e714350e3aadfd48040581f1.diff

LOG: [gn build] add scan-build target

Added: 
    llvm/utils/gn/secondary/clang/tools/scan-build/BUILD.gn

Modified: 
    clang/tools/scan-build/CMakeLists.txt
    llvm/utils/gn/secondary/BUILD.gn

Removed: 
    


################################################################################
diff  --git a/clang/tools/scan-build/CMakeLists.txt b/clang/tools/scan-build/CMakeLists.txt
index 28241245fcb7..ec0702d76f18 100644
--- a/clang/tools/scan-build/CMakeLists.txt
+++ b/clang/tools/scan-build/CMakeLists.txt
@@ -5,21 +5,26 @@ include(GNUInstallDirs)
 if (WIN32 AND NOT CYGWIN)
   set(BinFiles
         scan-build
-        scan-build.bat)
+        scan-build.bat
+	)
   set(LibexecFiles
         ccc-analyzer
         c++-analyzer
         ccc-analyzer.bat
-        c++-analyzer.bat)
+        c++-analyzer.bat
+	)
 else()
   set(BinFiles
-        scan-build)
+        scan-build
+	)
   set(LibexecFiles
         ccc-analyzer
-        c++-analyzer)
+        c++-analyzer
+	)
   if (APPLE)
     list(APPEND BinFiles
-           set-xcode-analyzer)
+           set-xcode-analyzer
+	   )
   endif()
 endif()
 

diff  --git a/llvm/utils/gn/secondary/BUILD.gn b/llvm/utils/gn/secondary/BUILD.gn
index c38d626e1b79..43c5b8a186ae 100644
--- a/llvm/utils/gn/secondary/BUILD.gn
+++ b/llvm/utils/gn/secondary/BUILD.gn
@@ -7,6 +7,7 @@ group("default") {
     "//clang-tools-extra/clangd/test",
     "//clang-tools-extra/test",
     "//clang/test",
+    "//clang/tools/scan-build",
     "//compiler-rt/include",
     "//compiler-rt/lib/scudo",
     "//lld/test",

diff  --git a/llvm/utils/gn/secondary/clang/tools/scan-build/BUILD.gn b/llvm/utils/gn/secondary/clang/tools/scan-build/BUILD.gn
new file mode 100644
index 000000000000..df65d461b741
--- /dev/null
+++ b/llvm/utils/gn/secondary/clang/tools/scan-build/BUILD.gn
@@ -0,0 +1,45 @@
+group("scan-build") {
+  deps = [
+    ":bin",
+    ":libexec",
+    ":man",
+    ":share",
+  ]
+}
+
+copy("bin") {
+  sources = [ "bin/scan-build" ]
+  if (host_os == "mac") {
+    sources += [ "bin/set-xcode-analyzer" ]
+  } else if (host_os == "win") {
+    sources += [ "bin/scan-build.bat" ]
+  }
+  outputs = [ "$root_build_dir/bin/{{source_file_part}}" ]
+}
+
+copy("libexec") {
+  sources = [
+    "libexec/ccc-analyzer",
+    "libexec/c++-analyzer",
+  ]
+  if (host_os == "win") {
+    sources += [
+      "libexec/ccc-analyzer.bat",
+      "libexec/c++-analyzer.bat",
+    ]
+  }
+  outputs = [ "$root_build_dir/libexec/{{source_file_part}}" ]
+}
+
+copy("man") {
+  sources = [ "man/scan-build.1" ]
+  outputs = [ "$root_build_dir/share/man/man1/{{source_file_part}}" ]
+}
+
+copy("share") {
+  sources = [
+    "share/scan-build/sorttable.js",
+    "share/scan-build/scanview.css",
+  ]
+  outputs = [ "$root_build_dir/share/scan-build/{{source_file_part}}" ]
+}


        


More information about the cfe-commits mailing list