Merge pull request #231 from annarev/fix_build_for_sync

A few build fixes
pull/13171/head
Joshua Haberman 5 years ago committed by GitHub
commit 1b131ca544
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 42
      BUILD
  2. 11
      CMakeLists.txt
  3. 1
      upb/port.c
  4. 4
      upb/port_def.inc

42
BUILD

@ -54,6 +54,17 @@ config_setting(
# Public C/C++ libraries #######################################################
cc_library(
name = "port",
textual_hdrs = [
"upb/port_def.inc",
"upb/port_undef.inc",
],
srcs = [
"upb/port.c",
],
)
cc_library(
name = "upb",
srcs = [
@ -62,9 +73,6 @@ cc_library(
"upb/generated_util.h",
"upb/msg.c",
"upb/msg.h",
"upb/port.c",
"upb/port_def.inc",
"upb/port_undef.inc",
"upb/table.c",
"upb/table.int.h",
"upb/upb.c",
@ -79,6 +87,7 @@ cc_library(
"//conditions:default": COPTS
}),
visibility = ["//visibility:public"],
deps = [":port"],
)
# Common support routines used by generated code. This library has no
@ -97,12 +106,11 @@ cc_library(
":windows": [],
"//conditions:default": COPTS
}),
textual_hdrs = [
"upb/port_def.inc",
"upb/port_undef.inc",
],
visibility = ["//visibility:public"],
deps = [":upb"],
deps = [
":port",
":upb",
],
)
upb_proto_library(
@ -138,7 +146,10 @@ cc_library(
cc_library(
name = "table",
hdrs = ["upb/table.int.h"],
deps = [":upb"],
deps = [
":port",
":upb",
],
)
# Legacy C/C++ Libraries (not recommended for new code) ########################
@ -146,6 +157,7 @@ cc_library(
cc_library(
name = "legacy_msg_reflection",
srcs = [
"upb/msg.h",
"upb/legacy_msg_reflection.c",
],
hdrs = ["upb/legacy_msg_reflection.h"],
@ -154,6 +166,7 @@ cc_library(
"//conditions:default": COPTS
}),
deps = [
":port",
":table",
":upb",
],
@ -286,6 +299,11 @@ cc_binary(
# C/C++ tests ##################################################################
upb_proto_reflection_library(
name = "descriptor_upbreflection",
deps = ["@com_google_protobuf//:descriptor_proto"],
)
cc_binary(
name = "benchmark",
testonly = 1,
@ -431,11 +449,6 @@ cc_binary(
)
# copybara:strip_for_google3_begin
upb_proto_reflection_library(
name = "descriptor_upbreflection",
deps = ["@com_google_protobuf//:descriptor_proto"],
)
cc_test(
name = "test_encoder",
srcs = ["tests/pb/test_encoder.cc"],
@ -563,6 +576,7 @@ upb_amalgamation(
":descriptor_upbproto",
":reflection",
":handlers",
":port",
":upb_pb",
":upb_json",
],

@ -60,23 +60,25 @@ endif()
enable_testing()
add_library(port
upb/port.c)
add_library(upb
upb/decode.c
upb/encode.c
upb/generated_util.h
upb/msg.c
upb/msg.h
upb/port.c
upb/port_def.inc
upb/port_undef.inc
upb/table.c
upb/table.int.h
upb/upb.c
upb/decode.h
upb/encode.h
upb/upb.h)
target_link_libraries(upb
port)
add_library(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE)
target_link_libraries(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE
port
upb)
add_library(reflection
upb/def.c
@ -89,11 +91,14 @@ target_link_libraries(reflection
upb)
add_library(table INTERFACE)
target_link_libraries(table INTERFACE
port
upb)
add_library(legacy_msg_reflection
upb/msg.h
upb/legacy_msg_reflection.c
upb/legacy_msg_reflection.h)
target_link_libraries(legacy_msg_reflection
port
table
upb)
add_library(handlers

@ -1,5 +1,4 @@
#include "upb/upb.h"
#include "upb/port_def.inc"
#ifdef UPB_MSVC_VSNPRINTF

@ -20,9 +20,7 @@
*
* This file is private and must not be included by users!
*/
#ifndef UINTPTR_MAX
#error must include stdint.h first
#endif
#include <stdint.h>
#if UINTPTR_MAX == 0xffffffff
#define UPB_SIZE(size32, size64) size32

Loading…
Cancel
Save