@@ -124,20 +124,13 @@ function (google_cloud_cpp_add_library_protos library)
124
124
endfunction ()
125
125
126
126
#
127
- # A function to add targets for GA libraries that use gRPC for transport.
127
+ # A function to add targets for GAPICS - libraries that use gRPC for transport.
128
128
#
129
129
# * library: the short name of the library, e.g. `kms`.
130
130
# * display_name: the display name of the library, e.g. "Cloud Key Management
131
131
# Service (KMS) API"
132
132
#
133
- # Additionally, we must set the following **variable** in the parent scope. We
134
- # cannot use a `cmake_parse_arguments()` keyword because it will skip the empty
135
- # string when provided in a list. We often need to use the empty string.
136
- #
137
- # * GOOGLE_CLOUD_CPP_SERVICE_DIRS: a list of service directories within the
138
- # library.
139
- #
140
- # The following **keywords** can be optionally supplied to handle edge cases:
133
+ # The function respects the following keywords:
141
134
#
142
135
# * ADDITIONAL_PROTO_LISTS: a list of proto files that may be used indirectly.
143
136
# `asset` sets this.
@@ -146,16 +139,18 @@ endfunction ()
146
139
# libraries for these, which link to the desired proto library. See #8022 for
147
140
# more details.
148
141
# * CROSS_LIB_DEPS: a list of client libraries which this library depends on.
142
+ # * SERVICE_DIRS: a list of service directories within the library. Use
143
+ # "__EMPTY__" to represent the empty string in the list.
149
144
# * SHARED_PROTO_DEPS: a list of proto libraries which this library depends on,
150
145
# e.g. `grafeas`. This function will define the proto library targets if they
151
146
# do not already exist.
152
147
#
153
- function (google_cloud_cpp_add_ga_grpc_library library display_name)
148
+ function (google_cloud_cpp_add_gapic_library library display_name)
154
149
cmake_parse_arguments (
155
150
_opt
156
151
"EXPERIMENTAL;TRANSITION"
157
152
""
158
- "ADDITIONAL_PROTO_LISTS;BACKWARDS_COMPAT_PROTO_TARGETS;CROSS_LIB_DEPS;SHARED_PROTO_DEPS"
153
+ "ADDITIONAL_PROTO_LISTS;BACKWARDS_COMPAT_PROTO_TARGETS;CROSS_LIB_DEPS;SERVICE_DIRS; SHARED_PROTO_DEPS"
159
154
${ARGN} )
160
155
if (_opt_EXPERIMENTAL AND _opt_TRANSITION)
161
156
message (
@@ -188,7 +183,7 @@ function (google_cloud_cpp_add_ga_grpc_library library display_name)
188
183
189
184
unset (mocks_globs)
190
185
unset (source_globs)
191
- foreach (dir IN LISTS GOOGLE_CLOUD_CPP_SERVICE_DIRS )
186
+ foreach (dir IN LISTS _opt_SERVICE_DIRS )
192
187
if ("${dir} " STREQUAL "__EMPTY__" )
193
188
set (dir "" )
194
189
endif ()
@@ -355,7 +350,7 @@ function (google_cloud_cpp_add_ga_grpc_library library display_name)
355
350
356
351
# ${library_alias} must be defined before we can add the samples.
357
352
if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS)
358
- foreach (dir IN LISTS GOOGLE_CLOUD_CPP_SERVICE_DIRS )
353
+ foreach (dir IN LISTS _opt_SERVICE_DIRS )
359
354
if ("${dir} " STREQUAL "__EMPTY__" )
360
355
set (dir "" )
361
356
endif ()
0 commit comments