75 lines · plain
1# This file is licensed under the Apache License v2.0 with LLVM Exceptions.2# See https://llvm.org/LICENSE.txt for license information.3# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception4 5load("@rules_cc//cc:defs.bzl", "cc_library")6 7package(8 default_visibility = ["//visibility:public"],9 features = ["layering_check"],10)11 12licenses(["notice"])13 14# TODO: this is a shim to provide Features.inc as needed by Feature.h.15# Replace this with something that parses Features.inc.in.16genrule(17 name = "gen_features_inc",18 outs = ["Features.inc"],19 cmd = "\n".join([20 "echo '// IWYU pragma: private, include \"Feature.h\"' >> $@",21 "echo '#define CLANGD_BUILD_XPC 0' >> $@",22 "echo '#define CLANGD_ENABLE_REMOTE 1' >> $@",23 "echo '#define ENABLE_GRPC_REFLECTION 0' >> $@",24 "echo '#define CLANGD_MALLOC_TRIM 0' >> $@",25 "echo '#define CLANGD_TIDY_CHECKS 1' >> $@",26 "echo '#define CLANGD_DECISION_FOREST 1' >> $@",27 ]),28)29 30# TODO: Pick up other files for more complete functionality, to match31# clangd/CMakeLists.txt. This might look something like32# glob(["*.cpp", "dir/**/*.cpp", ...]).33cc_library(34 name = "ClangDaemon",35 srcs = [36 "Feature.cpp",37 "Features.inc",38 "JSONTransport.cpp",39 "Protocol.cpp",40 "URI.cpp",41 "index/SymbolID.cpp",42 "support/Cancellation.cpp",43 "support/Context.cpp",44 "support/Logger.cpp",45 "support/MemoryTree.cpp",46 "support/Shutdown.cpp",47 "support/ThreadCrashReporter.cpp",48 "support/Trace.cpp",49 ],50 hdrs = [51 "Feature.h",52 "LSPBinder.h",53 "Protocol.h",54 "Transport.h",55 "URI.h",56 "index/SymbolID.h",57 "support/Cancellation.h",58 "support/Context.h",59 "support/Function.h",60 "support/Logger.h",61 "support/MemoryTree.h",62 "support/Shutdown.h",63 "support/ThreadCrashReporter.h",64 "support/Trace.h",65 ],66 includes = ["."],67 deps = [68 "//clang:basic",69 "//clang:index",70 "//llvm:Support",71 "//llvm:TargetParser",72 "//llvm:config",73 ],74)75