blob: 438ce04656f227b0818bc799e92ec226bae548c3 [file] [log] [blame]
Roger Meier122803b2012-06-18 20:23:58 +00001Building the Thrift IDL compiler in Windows
2-------------------------------------------
3
Chris Piro92e38602013-03-07 11:24:51 -05004The Visual Studio project contains pre-build commands to generate the
5thriftl.cc, thrifty.cc and thrifty.hh files which are necessary to build
Roger Meier122803b2012-06-18 20:23:58 +00006the 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
Chris Piro92e38602013-03-07 11:24:51 -050025> move src\thrifty.cc.hh src\thrifty.hh
Roger Meier122803b2012-06-18 20:23:58 +000026
Chris Piro92e38602013-03-07 11:24:51 -050027Download inttypes.h from the interwebs and place it in an include path
Roger Meier122803b2012-06-18 20:23:58 +000028location (e.g. thrift/compiler/cpp/src).
29
30Build the compiler in Visual Studio.