[llvm] r358837 - [gn] Move Features.inc to clangd, create a config for it
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 20 18:09:15 PDT 2019
Author: phosek
Date: Sat Apr 20 18:09:15 2019
New Revision: 358837
URL: http://llvm.org/viewvc/llvm-project?rev=358837&view=rev
Log:
[gn] Move Features.inc to clangd, create a config for it
ClangdLSPServer and clangd unittests now include Features.inc so we
need to append the target_gen_dir that contains it to their
include_dirs. To do so, we use a public config that's applied to
any target that depends on the features one.
Differential Revision: https://reviews.llvm.org/D60919
Modified:
llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn
llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/tool/BUILD.gn
llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/clangd/BUILD.gn
Modified: llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn?rev=358837&r1=358836&r2=358837&view=diff
==============================================================================
--- llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn (original)
+++ llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/BUILD.gn Sat Apr 20 18:09:15 2019
@@ -1,7 +1,29 @@
+import("//clang-tools-extra/clangd/xpc/enable.gni")
+import("//llvm/utils/gn/build/write_cmake_config.gni")
+
+config("features_config") {
+ # To pick up the generated inc files.
+ include_dirs = [ target_gen_dir ]
+ visibility = [ ":features" ]
+}
+
+write_cmake_config("features") {
+ input = "Features.inc.in"
+ output = "$target_gen_dir/Features.inc"
+ values = []
+ if (clangd_build_xpc) {
+ values += [ "CLANGD_BUILD_XPC=1" ]
+ } else {
+ values += [ "CLANGD_BUILD_XPC=0" ]
+ }
+ public_configs = [ ":features_config" ]
+}
+
static_library("clangd") {
output_name = "clangDaemon"
configs += [ "//llvm/utils/gn/build:clang_code" ]
deps = [
+ ":features",
"//clang-tools-extra/clang-tidy/abseil",
"//clang-tools-extra/clang-tidy/android",
"//clang-tools-extra/clang-tidy/boost",
Modified: llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/tool/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/tool/BUILD.gn?rev=358837&r1=358836&r2=358837&view=diff
==============================================================================
--- llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/tool/BUILD.gn (original)
+++ llvm/trunk/utils/gn/secondary/clang-tools-extra/clangd/tool/BUILD.gn Sat Apr 20 18:09:15 2019
@@ -1,25 +1,12 @@
import("//clang-tools-extra/clangd/xpc/enable.gni")
-import("//llvm/utils/gn/build/write_cmake_config.gni")
-
-write_cmake_config("features") {
- # FIXME: Try moving Features.inc.in to tools, seems like a better location.
- input = "../Features.inc.in"
- output = "$target_gen_dir/Features.inc"
- values = []
- if (clangd_build_xpc) {
- values += [ "CLANGD_BUILD_XPC=1" ]
- } else {
- values += [ "CLANGD_BUILD_XPC=0" ]
- }
-}
executable("clangd") {
configs += [ "//llvm/utils/gn/build:clang_code" ]
deps = [
- ":features",
"//clang-tools-extra/clang-tidy",
"//clang-tools-extra/clangd",
+ "//clang-tools-extra/clangd:features",
"//clang-tools-extra/clangd/refactor/tweaks",
"//clang/lib/AST",
"//clang/lib/Basic",
@@ -37,12 +24,7 @@ executable("clangd") {
]
}
- include_dirs = [
- "..",
-
- # To pick up the generated inc files.
- "$target_gen_dir",
- ]
+ include_dirs = [ ".." ]
sources = [
"ClangdMain.cpp",
]
Modified: llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/clangd/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/clangd/BUILD.gn?rev=358837&r1=358836&r2=358837&view=diff
==============================================================================
--- llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/clangd/BUILD.gn (original)
+++ llvm/trunk/utils/gn/secondary/clang-tools-extra/unittests/clangd/BUILD.gn Sat Apr 20 18:09:15 2019
@@ -5,6 +5,7 @@ unittest("ClangdTests") {
deps = [
"//clang-tools-extra/clang-tidy",
"//clang-tools-extra/clangd",
+ "//clang-tools-extra/clangd:features",
"//clang-tools-extra/clangd/refactor/tweaks",
"//clang/lib/AST",
"//clang/lib/Basic",
More information about the llvm-commits
mailing list