@@ -124,20 +124,13 @@ function (google_cloud_cpp_add_library_protos library)
124124endfunction ()
125125
126126#
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.
128128#
129129# * library: the short name of the library, e.g. `kms`.
130130# * display_name: the display name of the library, e.g. "Cloud Key Management
131131# Service (KMS) API"
132132#
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:
141134#
142135# * ADDITIONAL_PROTO_LISTS: a list of proto files that may be used indirectly.
143136# `asset` sets this.
@@ -146,16 +139,18 @@ endfunction ()
146139# libraries for these, which link to the desired proto library. See #8022 for
147140# more details.
148141# * 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.
149144# * SHARED_PROTO_DEPS: a list of proto libraries which this library depends on,
150145# e.g. `grafeas`. This function will define the proto library targets if they
151146# do not already exist.
152147#
153- function (google_cloud_cpp_add_ga_grpc_library library display_name )
148+ function (google_cloud_cpp_add_gapic_library library display_name )
154149 cmake_parse_arguments (
155150 _opt
156151 "EXPERIMENTAL;TRANSITION"
157152 ""
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"
159154 ${ARGN} )
160155 if (_opt_EXPERIMENTAL AND _opt_TRANSITION)
161156 message (
@@ -188,7 +183,7 @@ function (google_cloud_cpp_add_ga_grpc_library library display_name)
188183
189184 unset (mocks_globs)
190185 unset (source_globs)
191- foreach (dir IN LISTS GOOGLE_CLOUD_CPP_SERVICE_DIRS )
186+ foreach (dir IN LISTS _opt_SERVICE_DIRS )
192187 if ("${dir} " STREQUAL "__EMPTY__" )
193188 set (dir "" )
194189 endif ()
@@ -355,7 +350,7 @@ function (google_cloud_cpp_add_ga_grpc_library library display_name)
355350
356351 # ${library_alias} must be defined before we can add the samples.
357352 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 )
359354 if ("${dir} " STREQUAL "__EMPTY__" )
360355 set (dir "" )
361356 endif ()
0 commit comments