Skip to content

Commit

Permalink
rename gRPC_DLL_IMPORTS -> upb_DLL_IMPORTS (within upb)
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Oct 22, 2022
1 parent b08d3d9 commit bcbe895
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From e729e28581d741d6860bc9f989aa117737d92d98 Mon Sep 17 00:00:00 2001
From 1b5c3d1f5a58c3bb719635207266d24a02ff5237 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <h.vetinari@gmx.com>
Date: Mon, 12 Sep 2022 18:06:00 +0200
Subject: [PATCH 9/9] add GRPC_DLL mechanism for missing symbols on windows
Expand All @@ -14,7 +14,7 @@ Co-Authored-By: Isuru Fernando <isuruf@gmail.com>
6 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 511f2e9b2c..0d90cf15fd 100644
index 511f2e9b2c..27de6887e6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2322,6 +2322,8 @@ if(WIN32 AND MSVC)
Expand Down Expand Up @@ -64,7 +64,7 @@ index 511f2e9b2c..0d90cf15fd 100644
COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
)
+ # More details in include/grpc/impl/codegen/port_platform.h
+ set_target_properties(upb PROPERTIES DEFINE_SYMBOL "gRPC_DLL_EXPORTS")
+ set_target_properties(upb PROPERTIES DEFINE_SYMBOL "upb_DLL_EXPORTS")
if(gRPC_INSTALL)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/upb.pdb
DESTINATION ${gRPC_INSTALL_LIBDIR} OPTIONAL
Expand All @@ -74,7 +74,7 @@ index 511f2e9b2c..0d90cf15fd 100644

+if(WIN32 AND MSVC AND BUILD_SHARED_LIBS)
+ # More details in include/grpc/impl/codegen/port_platform.h
+ target_compile_definitions(upb INTERFACE gRPC_DLL_IMPORTS)
+ target_compile_definitions(upb INTERFACE upb_DLL_IMPORTS)
+endif()


Expand Down Expand Up @@ -123,7 +123,7 @@ index d6ef16130a..46b067c140 100644
typedef void (*child_postfork_func)(void);

diff --git a/third_party/upb/upb/port_def.inc b/third_party/upb/upb/port_def.inc
index 2b240ff6e8..dd71d745e9 100644
index 2b240ff6e8..cbf60968db 100644
--- a/third_party/upb/upb/port_def.inc
+++ b/third_party/upb/upb/port_def.inc
@@ -259,3 +259,12 @@ void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
Expand All @@ -132,13 +132,13 @@ index 2b240ff6e8..dd71d745e9 100644
#endif
+
+// More details in include/grpc/impl/codegen/port_platform.h
+#if defined(gRPC_DLL_EXPORTS)
+#if defined(upb_DLL_EXPORTS)
+#define GRPC_DLL __declspec(dllexport)
+#elif defined(gRPC_DLL_IMPORTS)
+#elif defined(upb_DLL_IMPORTS)
+#define GRPC_DLL __declspec(dllimport)
+#else
+#define GRPC_DLL
+#endif // defined(gRPC_DLL_EXPORTS)
+#endif // defined(upb_DLL_EXPORTS)
diff --git a/third_party/upb/upb/upb.c b/third_party/upb/upb/upb.c
index 55730bbe82..18c0067da6 100644
--- a/third_party/upb/upb/upb.c
Expand Down

0 comments on commit bcbe895

Please sign in to comment.