• Home
  • Raw
  • Download

Lines Matching +full:cmake +full:- +full:windows

1 gRPC C++ - Building from source
5 …/cpp#to-start-using-grpc-c) instructions for guidance on how to add gRPC as a dependency to a C++ …
7 # Pre-requisites
12 $ [sudo] apt-get install build-essential autoconf libtool pkg-config
15 If you plan to build using CMake
17 $ [sudo] apt-get install cmake
23 $ [sudo] apt-get install clang libc++-dev
34 $ [sudo] xcode-select --install
44 If you plan to build using CMake, follow the instructions from https://cmake.org/download/
55 ## Windows section in Pre-requisites
57 To prepare for cmake + Microsoft Visual C++ compiler build
58 - Install Visual Studio 2019 or later (Visual C++ compiler will be used).
59 - Install [Git](https://git-scm.com/).
60 - Install [CMake](https://cmake.org/download/).
61 - Install [nasm](https://www.nasm.us/) and add it to `PATH` (`choco install nasm`) - *required by b…
62 - (Optional) Install [Ninja](https://ninja-build.org/) (`choco install ninja`)
67 for gRPC's dependencies (that's done by the `submodule` command or `--recursive` flag). Use followi…
73 $ git clone -b RELEASE_TAG_HERE https://github.com/grpc/grpc
75 $ git submodule update --init
78 ## Windows section in Clone the repository (including submodules)
81 > git clone -b RELEASE_TAG_HERE https://github.com/grpc/grpc
83 > git submodule update --init
87 with something else than `bazel` (e.g. `cmake`).
93 we recommend building using `bazel` or `cmake`.
102 We support building with `bazel` on Linux, MacOS and Windows.
112 $ bazel test --config=dbg //test/...
116 This is because gRPC isn't fully compatible with bzlmod yet. To do this, add --enable_bzlmod=false …
121 ## Building with CMake
125 Run from the grpc directory after cloning the repo with --recursive or updating submodules.
127 $ mkdir -p cmake/build
128 $ cd cmake/build
129 $ cmake ../..
133 If you want to build shared libraries (`.so` files), run `cmake` with `-DBUILD_SHARED_LIBS=ON`.
135 ### Windows, Using Visual Studio 2019 or later
138 cmake will generate a solution (`grpc.sln`) that contains a VS project for
140 added automatically by cmake). After opening the solution with Visual Studio
143 > @rem Run from grpc directory after cloning the repo with --recursive or updating submodules.
146 > cmake .. -G "Visual Studio 16 2019"
147 > cmake --build . --config Release
150 Using gRPC C++ as a DLL is not recommended, but you can still enable it by running `cmake` with `-D…
152 ### Windows, Using Ninja (faster build).
157 > @rem Run from grpc directory after cloning the repo with --recursive or updating submodules.
158 > cd cmake
162 > cmake ..\.. -GNinja -DCMAKE_BUILD_TYPE=Release
163 > cmake --build .
166 Using gRPC C++ as a DLL is not recommended, but you can still enable it by running `cmake` with `-D…
168 ### Windows: A note on building shared libs (DLLs)
170 Windows DLL build is supported at a "best effort" basis and we don't recommend using gRPC C++ as a …
172 That said, we don't actively prohibit building DLLs on windows (it can be enabled in cmake with `-D…
174 - you've been warned that there are some important drawbacks and some things might not work at all …
175 - we don't have extensive testing for DLL builds in place (to avoid maintenance costs, increased te…
179 gRPC's CMake build system has two options for handling dependencies.
180 CMake can build the dependencies for you, or it can search for libraries
183 This behavior is controlled by the `gRPC_<depname>_PROVIDER` CMake variables,
186 * module - build dependencies alongside gRPC. The source code is obtained from
188 * package - use external copies of dependencies that are already available
190 you pre-installed them using CMake with the `CMAKE_INSTALL_PREFIX` option.
192 For example, if you set `gRPC_CARES_PROVIDER=module`, then CMake will build
193 c-ares before building gRPC. On the other hand, if you set
194 `gRPC_CARES_PROVIDER=package`, then CMake will search for a copy of c-ares
199 Perform the following steps to install gRPC using CMake.
200 * Set `-DgRPC_INSTALL=ON`
204 [`CMAKE_INSTALL_PREFIX`](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html) va…
206 If you are running CMake v3.13 or newer you can build gRPC's dependencies
210 If you are building gRPC < 1.27 or if you are using CMake < 3.13 you will need
214 how to install dependencies with cmake before proceeding to installing gRPC itself.
218 $ cmake ../.. -DgRPC_INSTALL=ON \
219 -DCMAKE_BUILD_TYPE=Release \
220 -DgRPC_ABSL_PROVIDER=package \
221 -DgRPC_CARES_PROVIDER=package \
222 -DgRPC_PROTOBUF_PROVIDER=package \
223 -DgRPC_RE2_PROVIDER=package \
224 -DgRPC_SSL_PROVIDER=package \
225 -DgRPC_ZLIB_PROVIDER=package
230 ### Cross-compiling
232 You can use CMake to cross-compile gRPC for another architecture. In order to
238 targeting for your cross-compile. Once you have done so, you can write a
239 toolchain file to tell CMake where to find the compilers and system tools
242 This toolchain file is specified to CMake by setting the `CMAKE_TOOLCHAIN_FILE`
245 $ cmake ../.. -DCMAKE_TOOLCHAIN_FILE=path/to/file
249 [Cross-compile example](test/distrib/cpp/run_distrib_test_cmake_aarch64_cross.sh)
251 ### A note on SONAME and its ABI compatibility implications in the cmake build
259 …d system, but we're no longer recommending it. You should use `bazel` or `cmake` instead. The `Mak…
266 … error on linux such as 'aclocal-1.15: command not found', which can happen if you ran 'make' befo…
268 $ git clean -f -d -x && git submodule foreach --recursive git clean -f -d -x
269 $ [sudo] apt-get install build-essential autoconf libtool pkg-config