blob: 8d9eb50ead90e6a936621055ee0ee7a3477616bd [file] [log] [blame] [view]
Pascal Bach6eb015a2014-04-17 16:19:07 +02001# Build compiler using CMake
2
3Use the following steps to build using cmake
4
Roger Meier746952e2014-06-14 21:59:24 +02005 mkdir build
6 cd build
7 cmake ..
8 make
Pascal Bach6eb015a2014-04-17 16:19:07 +02009
10## Build on windows
11
12In order to build on windows a few additional steps are necessary
13
141. Download winflexbison from http://sourceforge.net/projects/winflexbison/
152. Extract the winflex bison files to for e.g. C:\winflexbison
163. Make the CMake variables point to the correct binaries.
17 * FLEX_EXECUTBALE = C:/winbuild/win_flex.exe
18 * BISON_EXECUTBALE = C:/winbuild/win_bison.exe
19
Roger Meier746952e2014-06-14 21:59:24 +020020# Building the Thrift IDL compiler in Windows
21
22The Visual Studio project contains pre-build commands to generate the
23thriftl.cc, thrifty.cc and thrifty.hh files which are necessary to build
24the compiler. These depend on bison, flex and their dependencies to
25work properly. If this doesn't work on a system, try these manual
26pre-build steps.
27
28Open compiler.sln and remove the Pre-build commands under the project's
29 Properties -> Build Events -> Pre-Build Events.
30
31Download flex & bison from http://jaisantonyk.wordpress.com/2008/03/16/lex-and-yaccbison-in-windows/
32Download bison.simple in addition to bison.exe . This build of bison is easier to use
33than the one on sourceforge which has a myriad of dependencies.
34Place these binaries somewhere in the path.
35
36From a command prompt:
37> cd thrift/compiler/cpp
38> flex -osrc\thriftl.cc src\thriftl.ll
39In the generated thriftl.cc, comment out #include <unistd.h>
40
41Place a copy of bison.simple in thrift/compiler/cpp
42> bison -y -o "src/thrifty.cc" --defines src/thrifty.yy
43> move src\thrifty.cc.hh src\thrifty.hh
44
45Bison might generate the yacc header file "thrifty.cc.h" with just one h ".h" extension; in this case you'll have to rename to "thrifty.h".
46
47> move src\windows\version.h.in src\windows\version.h
48
49Download inttypes.h from the interwebs and place it in an include path
50location (e.g. thrift/compiler/cpp/src).
51
52Build the compiler in Visual Studio.