blob: a19f83d14334dce01a471129992e1a60ac2c5103 [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
Ben Craigfb89bb52013-08-30 13:46:05 -050027Bison 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".
28
29> move src\windows\version.h.in src\windows\version.h
30
Chris Piro92e38602013-03-07 11:24:51 -050031Download inttypes.h from the interwebs and place it in an include path
Roger Meier122803b2012-06-18 20:23:58 +000032location (e.g. thrift/compiler/cpp/src).
33
34Build the compiler in Visual Studio.