BUILD 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # Licensed to the Apache Software Foundation (ASF) under one or more
  2. # contributor license agreements. See the NOTICE file distributed with
  3. # this work for additional information regarding copyright ownership.
  4. # The ASF licenses this file to You under the Apache License, Version 2.0
  5. # (the "License"); you may not use this file except in compliance with
  6. # the License. You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. COPTS = [
  16. "-D__STDC_FORMAT_MACROS",
  17. "-DBTHREAD_USE_FAST_PTHREAD_MUTEX",
  18. "-D__const__=",
  19. "-D_GNU_SOURCE",
  20. "-DUSE_SYMBOLIZE",
  21. "-DNO_TCMALLOC",
  22. "-D__STDC_LIMIT_MACROS",
  23. "-D__STDC_CONSTANT_MACROS",
  24. "-fPIC",
  25. "-Wno-unused-parameter",
  26. "-fno-omit-frame-pointer",
  27. "-DGFLAGS_NS=google",
  28. ] + select({
  29. "//:with_glog": ["-DBRPC_WITH_GLOG=1"],
  30. "//conditions:default": ["-DBRPC_WITH_GLOG=0"],
  31. })
  32. proto_library(
  33. name = "echo_c++_proto",
  34. srcs = [
  35. "echo_c++/echo.proto",
  36. ],
  37. )
  38. cc_proto_library(
  39. name = "cc_echo_c++_proto",
  40. deps = [
  41. ":echo_c++_proto",
  42. ],
  43. )
  44. cc_binary(
  45. name = "echo_c++_server",
  46. srcs = [
  47. "echo_c++/server.cpp",
  48. ],
  49. includes = [
  50. "echo_c++",
  51. ],
  52. deps = [
  53. ":cc_echo_c++_proto",
  54. "//:brpc",
  55. ],
  56. copts = COPTS,
  57. )
  58. cc_binary(
  59. name = "echo_c++_client",
  60. srcs = [
  61. "echo_c++/client.cpp",
  62. ],
  63. includes = [
  64. "echo_c++",
  65. ],
  66. deps = [
  67. ":cc_echo_c++_proto",
  68. "//:brpc",
  69. ],
  70. copts = COPTS,
  71. )