* cmake: don't install plugins when crosscompiling
Plugins should not be installed for a cross-compilation environment,
because it has to run on a host/build system. If it's installed then
configure stage fails with an error, that imported target references
non-existing file. Even if the file is found, it can't be used on a host.
Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
* better way of detecting protoc targets
Co-authored-by: Jan Tattermusch <jtattermusch@google.com>
* cmake: Use major.minor for the SONAME for C++ and C#
This helps to localize the ABI changes between versions and makes
possible to install different versions of GRPC side-by-side on the same
root filesystem. This is still not an ideal solution, but at least the
expectation would be whenever the core version has changed, the SONAME
would be different for any other related artifacts.
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
* doc: Add section about ABI compat to BUILDING.md
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
They use PACKAGE_VERSION to generate version information but
PACKAGE_VERSION may be overridden by find_package(). For example,
-DgRPC_CARES_PROVIDER=package with c-ares 1.16.0 overrides
PACKAGE_VERSION to 1.16.0. Because c-ares-config-version.cmake has the
following line:
set(PACKAGE_VERSION "1.16.0")
Setting PACKAGE_VERSION in version.cmake is a common CMake convention:
https://cmake.org/cmake/help/latest/command/find_package.html#version-selection
> PACKAGE_VERSION
>
> full provided version string
So we should use gRPC_CPP_VERSION not PACKAGE_VERSION to generate
gRPCConfigVersion.cmake and grpc++*.pc.
This is a CMake find-module, which attempts to find c-ares without
a CMake package file being available. If such a file is available,
it uses that. Otherwise, it searches for the library and include
directory manually.
Remove some spaces at the end of lines. Change how variables are
referenced inside if() statements. Remove the space between if/endif
and the first parenthesis. Remove the duplicated condition from endif()
blocks. Make indentation more consistent. Remove unneeded duplicate
PRIVATE keywords from target_include_directories(). Remove redundant
set_source_files_properties() call, as the file is already GENERATED.
.proto files that are used by more than one target have their code
files generated multiple times, which causes issues with
add_custom_command(). De-duplicate them so they're only generated
once.
The Google Benchmark CMake build needs CMake 3.5.1 or newer. CMake 3.5.1
was released May 24, 2016 and is available in Debian stable and Ubuntu
16.04 and 18.04.