Add a library that just contains port_platform.h (#26715)

pull/26730/head
Craig Tiller 3 years ago committed by GitHub
parent 0f98fab8cf
commit 2b6b0619a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      BUILD
  2. 2
      src/core/lib/gprpp/match.h
  3. 2
      src/core/lib/gprpp/overload.h
  4. 2
      tools/run_tests/sanity/check_port_platform.py

16
BUILD

@ -715,6 +715,16 @@ grpc_cc_library(
visibility = ["@grpc:public"],
)
# A library that vends only port_platform, so that libraries that don't need
# anything else from gpr can still be portable!
grpc_cc_library(
name = "gpr_platform",
language = "c++",
public_hdrs = [
"include/grpc/impl/codegen/port_platform.h",
],
)
grpc_cc_library(
name = "grpc_trace",
srcs = ["src/core/lib/debug/trace.cc"],
@ -750,6 +760,7 @@ grpc_cc_library(
name = "overload",
language = "c++",
public_hdrs = ["src/core/lib/gprpp/overload.h"],
deps = ["gpr_platform"],
)
grpc_cc_library(
@ -759,7 +770,10 @@ grpc_cc_library(
],
language = "c++",
public_hdrs = ["src/core/lib/gprpp/match.h"],
deps = ["overload"],
deps = [
"gpr_platform",
"overload",
],
)
grpc_cc_library(

@ -15,7 +15,7 @@
#ifndef GRPC_CORE_LIB_GPRPP_MATCH_H
#define GRPC_CORE_LIB_GPRPP_MATCH_H
// Portable code. port_platform.h is not required.
#include <grpc/impl/codegen/port_platform.h>
#include "absl/types/variant.h"
#include "src/core/lib/gprpp/overload.h"

@ -15,7 +15,7 @@
#ifndef GRPC_CORE_LIB_GPRPP_OVERLOAD_H
#define GRPC_CORE_LIB_GPRPP_OVERLOAD_H
// Portable code. port_platform.h is not required.
#include <grpc/impl/codegen/port_platform.h>
#include <utility>

@ -44,8 +44,6 @@ def check_port_platform_inclusion(directory_root):
with open(path) as f:
all_lines_in_file = f.readlines()
for index, l in enumerate(all_lines_in_file):
if l == '// Portable code. port_platform.h is not required.\n':
break
if '#include' in l:
if l not in [
'#include <grpc/support/port_platform.h>\n',

Loading…
Cancel
Save