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