@ -421,8 +421,29 @@ endif()
if ( WIN32 )
set ( _gRPC_ALLTARGETS_LIBRARIES ${ _gRPC_ALLTARGETS_LIBRARIES } ws2_32 crypt32 )
set ( _gRPC_STATIC_WIN32 STATIC )
endif ( )
if ( BUILD_SHARED_LIBS AND WIN32 )
# C u r r e n t l y f o r s h a r e d l i b o n Windows ( i.e. a DLL ) c e r t a i n b i t s o f s o u r c e c o d e
# a r e g e n e r a t e d f r o m p r o t o b u f d e f i n i t i o n s b y u p b c . T h i s s o u r c e c o d e d o e s n o t i n c l u d e
# a n n o t a t i o n s n e e d e d t o e x p o r t t h e s e f u n c t i o n s f r o m g p r c . l i b s o w e h a v e t o
# r e - i n c l u d e a s m a l l s u b s e t o f t h e s e .
#
# T h i s i s n o t a n i d e a l s i t u a t i o n b e c a u s e t h e s e f u n c t i o n s w i l l b e u n a v a i l a b l e
# t o c l i e n t s o f g r p c a n d t h e l i b r a r i e s t h a t n e e d this ( e.g. grpc++ ) w i l l
# i n c l u d e r e d u n d a n t d u p l i c a t e c o d e . H e n c e , t h e d u p l i c a t i o n i s o n l y a c t i v a t e d
# f o r D L L b u i l d s - a n d s h o u l d b e c o m p l e t e l y r e m o v e d w h e n s o u r c e f i l e s a r e
# g e n e r a t e d w i t h t h e n e c e s s a r y _ _ d e c l s p e c a n n o t a t i o n s .
set ( gRPC_UPB_GEN_DUPL_SRC
s r c / c o r e / e x t / u p b - g e n e r a t e d / s r c / p r o t o / g r p c / g c p / a l t s c o n t e x t . u p b . c
s r c / c o r e / e x t / u p b - g e n e r a t e d / s r c / p r o t o / g r p c / h e a l t h / v 1 / h e a l t h . u p b . c
s r c / c o r e / e x t / u p b - g e n e r a t e d / s r c / p r o t o / g r p c / g c p / t r a n s p o r t _ s e c u r i t y _ c o m m o n . u p b . c
)
endif ( ) # B U I L D _ S H A R E D _ L I B S A N D WIN32
# C r e a t e d i r e c t o r y f o r p r o t o s o u r c e f i l e s
set ( _gRPC_PROTO_SRCS_DIR ${ CMAKE_BINARY_DIR } /protos )
file ( MAKE_DIRECTORY ${ _gRPC_PROTO_SRCS_DIR } )
@ -1481,6 +1502,7 @@ if(gRPC_BUILD_TESTS)
endif ( )
add_library ( address_sorting
t h i r d _ p a r t y / a d d r e s s _ s o r t i n g / a d d r e s s _ s o r t i n g . c
t h i r d _ p a r t y / a d d r e s s _ s o r t i n g / a d d r e s s _ s o r t i n g _ p o s i x . c
@ -1534,6 +1556,7 @@ if(gRPC_INSTALL)
endif ( )
add_library ( gpr
s r c / c o r e / l i b / c o n f i g / c o n f i g _ v a r s . c c
s r c / c o r e / l i b / c o n f i g / c o n f i g _ v a r s _ n o n _ g e n e r a t e d . c c
@ -1594,6 +1617,10 @@ if(WIN32 AND MSVC)
set_target_properties ( gpr PROPERTIES COMPILE_PDB_NAME "gpr"
C O M P I L E _ P D B _ O U T P U T _ D I R E C T O R Y " $ { C M A K E _ B I N A R Y _ D I R } "
)
set_target_properties ( gpr PROPERTIES DEFINE_SYMBOL "GPR_DLL_EXPORTS" )
if ( BUILD_SHARED_LIBS )
target_compile_definitions ( gpr INTERFACE GPR_DLL_IMPORTS )
endif ( )
if ( gRPC_INSTALL )
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } /gpr.pdb
D E S T I N A T I O N $ { g R P C _ I N S T A L L _ L I B D I R } O P T I O N A L
@ -1692,6 +1719,7 @@ if(gRPC_INSTALL)
endif ( )
add_library ( grpc
s r c / c o r e / e x t / f i l t e r s / b a c k e n d _ m e t r i c s / b a c k e n d _ m e t r i c _ f i l t e r . c c
s r c / c o r e / e x t / f i l t e r s / c e n s u s / g r p c _ c o n t e x t . c c
@ -2480,6 +2508,10 @@ if(WIN32 AND MSVC)
set_target_properties ( grpc PROPERTIES COMPILE_PDB_NAME "grpc"
C O M P I L E _ P D B _ O U T P U T _ D I R E C T O R Y " $ { C M A K E _ B I N A R Y _ D I R } "
)
set_target_properties ( grpc PROPERTIES DEFINE_SYMBOL "GRPC_DLL_EXPORTS" )
if ( BUILD_SHARED_LIBS )
target_compile_definitions ( grpc INTERFACE GRPC_DLL_IMPORTS )
endif ( )
if ( gRPC_INSTALL )
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } /grpc.pdb
D E S T I N A T I O N $ { g R P C _ I N S T A L L _ L I B D I R } O P T I O N A L
@ -2618,6 +2650,7 @@ endif()
if ( gRPC_BUILD_TESTS )
add_library ( grpc_test_util
t e s t / c o r e / e v e n t _ e n g i n e / t e s t _ i n i t . c c
t e s t / c o r e / u t i l / b u i l d . c c
@ -2677,6 +2710,7 @@ endif()
endif ( )
if ( gRPC_BUILD_TESTS )
add_library ( grpc_test_util_unsecure
t e s t / c o r e / e v e n t _ e n g i n e / t e s t _ i n i t . c c
t e s t / c o r e / u t i l / b u i l d . c c
@ -2734,6 +2768,7 @@ endif()
endif ( )
add_library ( grpc_unsecure
s r c / c o r e / e x t / f i l t e r s / b a c k e n d _ m e t r i c s / b a c k e n d _ m e t r i c _ f i l t e r . c c
s r c / c o r e / e x t / f i l t e r s / c e n s u s / g r p c _ c o n t e x t . c c
@ -3132,6 +3167,10 @@ if(WIN32 AND MSVC)
set_target_properties ( grpc_unsecure PROPERTIES COMPILE_PDB_NAME "grpc_unsecure"
C O M P I L E _ P D B _ O U T P U T _ D I R E C T O R Y " $ { C M A K E _ B I N A R Y _ D I R } "
)
set_target_properties ( grpc_unsecure PROPERTIES DEFINE_SYMBOL "GRPC_DLL_EXPORTS" )
if ( BUILD_SHARED_LIBS )
target_compile_definitions ( grpc_unsecure INTERFACE GRPC_DLL_IMPORTS )
endif ( )
if ( gRPC_INSTALL )
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } /grpc_unsecure.pdb
D E S T I N A T I O N $ { g R P C _ I N S T A L L _ L I B D I R } O P T I O N A L
@ -3268,6 +3307,7 @@ endif()
if ( gRPC_BUILD_TESTS )
add_library ( gtest
t h i r d _ p a r t y / g o o g l e t e s t / g o o g l e m o c k / s r c / g m o c k - c a r d i n a l i t i e s . c c
t h i r d _ p a r t y / g o o g l e t e s t / g o o g l e m o c k / s r c / g m o c k - i n t e r n a l - u t i l s . c c
@ -3334,7 +3374,8 @@ target_link_libraries(gtest
endif ( )
add_library ( upb
add_library ( upb ${ _gRPC_STATIC_WIN32 }
t h i r d _ p a r t y / u p b / u p b / b a s e / s t a t u s . c
t h i r d _ p a r t y / u p b / u p b / c o l l e c t i o n s / a r r a y . c
t h i r d _ p a r t y / u p b / u p b / c o l l e c t i o n s / m a p . c
@ -3405,7 +3446,8 @@ if(gRPC_INSTALL)
endif ( )
add_library ( upb_collections_lib
add_library ( upb_collections_lib ${ _gRPC_STATIC_WIN32 }
t h i r d _ p a r t y / u p b / u p b / b a s e / s t a t u s . c
t h i r d _ p a r t y / u p b / u p b / c o l l e c t i o n s / a r r a y . c
t h i r d _ p a r t y / u p b / u p b / c o l l e c t i o n s / m a p . c
@ -3466,7 +3508,8 @@ if(gRPC_INSTALL)
endif ( )
add_library ( upb_json_lib
add_library ( upb_json_lib ${ _gRPC_STATIC_WIN32 }
s r c / c o r e / e x t / u p b - g e n e r a t e d / g o o g l e / p r o t o b u f / d e s c r i p t o r . u p b . c
t h i r d _ p a r t y / u p b / u p b / j s o n / d e c o d e . c
t h i r d _ p a r t y / u p b / u p b / j s o n / e n c o d e . c
@ -3543,7 +3586,8 @@ if(gRPC_INSTALL)
endif ( )
add_library ( upb_textformat_lib
add_library ( upb_textformat_lib ${ _gRPC_STATIC_WIN32 }
s r c / c o r e / e x t / u p b - g e n e r a t e d / g o o g l e / p r o t o b u f / d e s c r i p t o r . u p b . c
t h i r d _ p a r t y / u p b / u p b / m e s s a g e / a c c e s s o r s . c
t h i r d _ p a r t y / u p b / u p b / m i n i _ d e s c r i p t o r / b u i l d _ e n u m . c
@ -3619,6 +3663,7 @@ if(gRPC_INSTALL)
endif ( )
add_library ( utf8_range_lib
t h i r d _ p a r t y / u t f 8 _ r a n g e / n a i v e . c
t h i r d _ p a r t y / u t f 8 _ r a n g e / r a n g e 2 - n e o n . c
@ -3674,6 +3719,7 @@ endif()
if ( gRPC_BUILD_TESTS )
if ( gRPC_BUILD_CODEGEN )
add_library ( benchmark_helpers
$ { _ g R P C _ P R O T O _ G E N S _ D I R } / s r c / p r o t o / g r p c / t e s t i n g / e c h o . p b . c c
$ { _ g R P C _ P R O T O _ G E N S _ D I R } / s r c / p r o t o / g r p c / t e s t i n g / e c h o . g r p c . p b . c c
@ -3749,6 +3795,7 @@ endif()
endif ( )
add_library ( grpc++
s r c / c o r e / e x t / t r a n s p o r t / b i n d e r / c l i e n t / b i n d e r _ c o n n e c t o r . c c
s r c / c o r e / e x t / t r a n s p o r t / b i n d e r / c l i e n t / c h a n n e l _ c r e a t e . c c
@ -3815,6 +3862,7 @@ add_library(grpc++
s r c / c p p / u t i l / s t a t u s . c c
s r c / c p p / u t i l / s t r i n g _ r e f . c c
s r c / c p p / u t i l / t i m e _ c c . c c
$ { g R P C _ U P B _ G E N _ D U P L _ S R C }
)
target_compile_features ( grpc++ PUBLIC cxx_std_14 )
@ -3828,6 +3876,10 @@ if(WIN32 AND MSVC)
set_target_properties ( grpc++ PROPERTIES COMPILE_PDB_NAME "grpc++"
C O M P I L E _ P D B _ O U T P U T _ D I R E C T O R Y " $ { C M A K E _ B I N A R Y _ D I R } "
)
set_target_properties ( grpc++ PROPERTIES DEFINE_SYMBOL "GRPCXX_DLL_EXPORTS" )
if ( BUILD_SHARED_LIBS )
target_compile_definitions ( grpc++ INTERFACE GRPCXX_DLL_IMPORTS )
endif ( )
if ( gRPC_INSTALL )
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } /grpc++.pdb
D E S T I N A T I O N $ { g R P C _ I N S T A L L _ L I B D I R } O P T I O N A L
@ -4079,9 +4131,11 @@ if(gRPC_INSTALL)
endif ( )
add_library ( grpc++_alts
s r c / c p p / c o m m o n / a l t s _ c o n t e x t . c c
s r c / c p p / c o m m o n / a l t s _ u t i l . c c
$ { g R P C _ U P B _ G E N _ D U P L _ S R C }
)
target_compile_features ( grpc++_alts PUBLIC cxx_std_14 )
@ -4143,6 +4197,7 @@ if(gRPC_INSTALL)
endif ( )
add_library ( grpc++_error_details
s r c / c p p / u t i l / e r r o r _ d e t a i l s . c c
)
@ -4207,6 +4262,7 @@ endif()
if ( gRPC_BUILD_CODEGEN )
add_library ( grpc++_reflection
$ { _ g R P C _ P R O T O _ G E N S _ D I R } / s r c / p r o t o / g r p c / r e f l e c t i o n / v 1 a l p h a / r e f l e c t i o n . p b . c c
$ { _ g R P C _ P R O T O _ G E N S _ D I R } / s r c / p r o t o / g r p c / r e f l e c t i o n / v 1 a l p h a / r e f l e c t i o n . g r p c . p b . c c
@ -4279,6 +4335,7 @@ endif()
endif ( )
if ( gRPC_BUILD_TESTS )
add_library ( grpc++_test
s r c / c p p / c l i e n t / c h a n n e l _ t e s t _ p e e r . c c
)
@ -4344,6 +4401,7 @@ endforeach()
endif ( )
if ( gRPC_BUILD_TESTS )
add_library ( grpc++_test_config
t e s t / c p p / u t i l / t e s t _ c o n f i g _ c c . c c
)
@ -4390,6 +4448,7 @@ target_link_libraries(grpc++_test_config
endif ( )
if ( gRPC_BUILD_TESTS )
add_library ( grpc++_test_util
s r c / c o r e / l i b / g p r / s u b p r o c e s s _ p o s i x . c c
s r c / c o r e / l i b / g p r / s u b p r o c e s s _ w i n d o w s . c c
@ -4455,6 +4514,30 @@ target_link_libraries(grpc++_test_util
endif ( )
# f o r D L L b u i l d j u s t c o m p i l e a d u m m y g r p c + + _ u n s e c u r e
# T h i s i s a t e m p o r a r y s i t u a t i o n u n t i l s o m e c o d e r e s t r u c t u r i n g
# o b v i a t e s t h e n e e d t o e x c l u d e t h i s l i b r a r y
if ( BUILD_SHARED_LIBS AND MSVC )
add_library ( grpc++_unsecure
s r c / c p p / c o m m o n / v e r s i o n _ c c . c c
)
target_include_directories ( grpc++_unsecure
P U B L I C $ < I N S T A L L _ I N T E R F A C E : $ { g R P C _ I N S T A L L _ I N C L U D E D I R } > $ < B U I L D _ I N T E R F A C E : $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / i n c l u d e >
P R I V A T E
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R }
)
foreach ( _hdr
i n c l u d e / g r p c p p / g r p c p p . h
)
string ( REPLACE "include/" "" _path ${ _hdr } )
get_filename_component ( _path ${ _path } PATH )
install ( FILES ${ _hdr }
D E S T I N A T I O N " $ { g R P C _ I N S T A L L _ I N C L U D E D I R } / $ { _ p a t h } "
)
endforeach ( )
else ( )
add_library ( grpc++_unsecure
s r c / c p p / c l i e n t / c h a n n e l _ c c . c c
s r c / c p p / c l i e n t / c l i e n t _ c a l l b a c k . c c
@ -4493,6 +4576,7 @@ add_library(grpc++_unsecure
s r c / c p p / u t i l / s t a t u s . c c
s r c / c p p / u t i l / s t r i n g _ r e f . c c
s r c / c p p / u t i l / t i m e _ c c . c c
$ { g R P C _ U P B _ G E N _ D U P L _ S R C }
)
target_compile_features ( grpc++_unsecure PUBLIC cxx_std_14 )
@ -4506,6 +4590,10 @@ if(WIN32 AND MSVC)
set_target_properties ( grpc++_unsecure PROPERTIES COMPILE_PDB_NAME "grpc++_unsecure"
C O M P I L E _ P D B _ O U T P U T _ D I R E C T O R Y " $ { C M A K E _ B I N A R Y _ D I R } "
)
set_target_properties ( grpc++_unsecure PROPERTIES DEFINE_SYMBOL "GRPCXX_DLL_EXPORTS" )
if ( BUILD_SHARED_LIBS )
target_compile_definitions ( grpc++_unsecure INTERFACE GRPCXX_DLL_IMPORTS )
endif ( )
if ( gRPC_INSTALL )
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } /grpc++_unsecure.pdb
D E S T I N A T I O N $ { g R P C _ I N S T A L L _ L I B D I R } O P T I O N A L
@ -4741,6 +4829,7 @@ foreach(_hdr
D E S T I N A T I O N " $ { g R P C _ I N S T A L L _ I N C L U D E D I R } / $ { _ p a t h } "
)
endforeach ( )
endif ( ) # B U I L D _ S H A R E D _ L I B S A N D MSVC
if ( gRPC_INSTALL )
@ -4753,6 +4842,7 @@ if(gRPC_INSTALL)
endif ( )
add_library ( grpc_authorization_provider
s r c / c o r e / e x t / u p b - g e n e r a t e d / g o o g l e / p r o t o b u f / a n y . u p b . c
s r c / c o r e / e x t / u p b - g e n e r a t e d / g o o g l e / p r o t o b u f / d e s c r i p t o r . u p b . c
@ -5161,6 +5251,7 @@ if(gRPC_INSTALL)
endif ( )
add_library ( grpc_plugin_support
s r c / c o m p i l e r / c p p _ g e n e r a t o r . c c
s r c / c o m p i l e r / c s h a r p _ g e n e r a t o r . c c
@ -5235,6 +5326,7 @@ endif()
# g r p c p p _ c h a n n e l z d o e s n ' t b u i l d w i t h p r o t o b u f - l i t e
# S e e h t t p s : / / g i t h u b . c o m / g r p c / g r p c / i s s u e s / 1 9 4 7 3
if ( gRPC_BUILD_CODEGEN AND NOT gRPC_USE_PROTO_LITE )
add_library ( grpcpp_channelz
$ { _ g R P C _ P R O T O _ G E N S _ D I R } / s r c / p r o t o / g r p c / c h a n n e l z / c h a n n e l z . p b . c c
$ { _ g R P C _ P R O T O _ G E N S _ D I R } / s r c / p r o t o / g r p c / c h a n n e l z / c h a n n e l z . g r p c . p b . c c