]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/thrift/build/cmake/README-MSYS2.md
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / jaegertracing / thrift / build / cmake / README-MSYS2.md
1 <!---
2 Licensed under the Apache License, Version 2.0 (the "License");
3 you may not use this file except in compliance with the License.
4 You may obtain a copy of the License at
5
6 http://www.apache.org/licenses/LICENSE-2.0
7
8 Unless required by applicable law or agreed to in writing, software
9 distributed under the License is distributed on an "AS IS" BASIS,
10 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 See the License for the specific language governing permissions and
12 limitations under the License.
13 -->
14
15 # Building thrift on Windows (MinGW64/MSYS2)
16
17 Thrift uses cmake to make it easier to build the project on multiple platforms, however to build a fully functional and production ready thrift on Windows requires a number of third party libraries to be obtained. Once third party libraries are ready, the right combination of options must be passed to cmake in order to generate the correct environment.
18
19 > Note: libevent and libevent-devel do not work with this toolchain as they do not properly detect mingw64 and expect some headers to exist that do not, so the non-blocking server is not currently built into this solution.
20
21 ## MSYS2
22
23 Download and fully upgrade msys2 following the instructions at:
24
25 https://msys2.github.io/
26
27 Install the necessary toolchain items for C++:
28
29 $ pacman --needed -S bison flex make mingw-w64-x86_64-openssl \
30 mingw-w64-x86_64-boost mingw-w64-x86_64-cmake \
31 mingw-w64-x86_64-toolchain mingw-w64-x86_64-zlib
32
33 Update your msys2 bash path to include /mingw64/bin by adding a line to your ~/.bash_profiles using this command:
34
35 echo "export PATH=/mingw64/bin:\$PATH" >> ~/.bash_profile
36
37 After that, close your shell and open a new one.
38
39 Use cmake to create a MinGW makefile, out of tree (assumes you are in the top level of the thrift source tree):
40
41 mkdir ../thrift-build
42 cd ../thrift-build
43 cmake -G"MinGW Makefiles" -DCMAKE_MAKE_PROGRAM=/mingw64/bin/mingw32-make \
44 -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc.exe \
45 -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++.exe \
46 -DWITH_LIBEVENT=OFF \
47 -DWITH_SHARED_LIB=OFF -DWITH_STATIC_LIB=ON \
48 -DWITH_JAVA=OFF -DWITH_PYTHON=OFF -DWITH_PERL=OFF \
49 ../thrift
50
51 Build thrift (inside thrift-build):
52
53 cmake --build .
54
55 Run the tests (inside thrift-build):
56
57 ctest
58
59 > If you run into issues, check Apache Jira THRIFT-4046 for patches relating to MinGW64/MSYS2 builds.
60
61 ## Tested With
62
63 msys2 64-bit 2016-10-26 distribution