blob: a7fccea15764e959cca2fa920d76bc1ed9e5b824 [file] [log] [blame]
Roger Meier122803b2012-06-18 20:23:58 +00001Building the Thrift IDL compiler in Windows
2-------------------------------------------
3
4The Visual Studio project contains pre-build commands to generate the
5thriftl.cc, thrifty.cc and thrifty.h files which are necessary to build
6the compiler. These depend on bison, flex and their dependencies to
7work properly. If this doesn't work on a system, try these manual
8pre-build steps.
9
10Open compiler.sln and remove the Pre-build commands under the project's
11 Properties -> Build Events -> Pre-Build Events.
12
13Download flex & bison from http://jaisantonyk.wordpress.com/2008/03/16/lex-and-yaccbison-in-windows/
14Download bison.simple in addition to bison.exe . This build of bison is easier to use
15than the one on sourceforge which has a myriad of dependencies.
16Place these binaries somewhere in the path.
17
18From a command prompt:
19> cd thrift/compiler/cpp
20> flex -osrc\thriftl.cc src\thriftl.ll
21In the generated thriftl.cc, comment out #include <unistd.h>
22
23Place a copy of bison.simple in thrift/compiler/cpp
24> bison -y -o "src/thrifty.cc" --defines src/thrifty.yy
25> move src\thrifty.cc.h src\thrifty.h
26
27Download inttypes.h from the interwebs and place it in an include path
28location (e.g. thrift/compiler/cpp/src).
29
30Build the compiler in Visual Studio.