When the implementation is in the header file, there's an "incomplete type" error caused by grpc_server_credentials.
Compiling with clang version 11.0.0 (https://github.com/llvm/llvm-project.git 8697d443ab24d1652d09393efca768cdf4c22b39), Target: x86_64-apple-darwin19.4.0
through cmake's add_subdirectory( lib/grpc ) in a parent project
[...] Building CXX object lib/grpc/CMakeFiles/grpc.dir/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc.o
FAILED: lib/grpc/CMakeFiles/grpc.dir/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc.o
/usr/local/opt/llvm/latest/bin/clang++ -DCARES_STATICLIB -D__CLANG_SUPPORT_DYN_ANNOTATION__ -I../../lib/grpc/third_party/zlib -I../../lib/grpc/include -I../../lib/grpc -I../../lib/grpc/third_party/address_sorting/include -I../../lib/grpc/third_party/boringssl-with-bazel/src/include -I../../lib/grpc/src/core/ext/upb-generated -I../../lib/grpc/third_party/upb -Ilib/grpc/third_party/zlib -Ilib/grpc/third_party/cares/cares -I../../lib/grpc/third_party/cares/cares -I../../lib/grpc/third_party/abseil-cpp -stdlib=libc++ -nostdinc++ -ibuiltininc -I /usr/local/opt/llvm/latest/include/c++/v1 -fcxx-exceptions -fassociative-math -freciprocal-math -march=native -mtune=native -fforce-emit-vtables -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.15 -fPIC -std=c++2a -MD -MT lib/grpc/CMakeFiles/grpc.dir/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc.o -MF lib/grpc/CMakeFiles/grpc.dir/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc.o.d -o lib/grpc/CMakeFiles/grpc.dir/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc.o -c ../../lib/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc
In file included from ../../lib/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.cc:21:
In file included from ../../lib/grpc/src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h:28:
In file included from ../../lib/grpc/src/core/lib/gprpp/ref_counted.h:36:
../../lib/grpc/src/core/lib/gprpp/ref_counted_ptr.h:103:34: error: member access into incomplete type 'grpc_server_credentials'
if (value_ != nullptr) value_->Unref();
^
../../lib/grpc/src/core/lib/security/security_connector/security_connector.h:154:3: note: in instantiation of member function 'grpc_core::RefCountedPtr<grpc_server_credentials>::~RefCountedPtr' requested here
~grpc_server_security_connector() override = default;
^
../../lib/grpc/include/grpc/grpc_security.h:465:16: note: forward declaration of 'grpc_server_credentials'
typedef struct grpc_server_credentials grpc_server_credentials;
- if xds routing is disabled: only allow matcher to be empty or single
slash( same behaviour as 1.28)
- if xds routing is enabled: ignore all supported path matchers and reject
all unsupported path matchers