| Roger Meier | 84e4a3c | 2011-09-16 20:58:44 +0000 | [diff] [blame] | 1 | Thrift C++ Software Library | 
 | 2 |  | 
 | 3 | License | 
 | 4 | ======= | 
 | 5 |  | 
 | 6 | Licensed to the Apache Software Foundation (ASF) under one | 
 | 7 | or more contributor license agreements. See the NOTICE file | 
 | 8 | distributed with this work for additional information | 
 | 9 | regarding copyright ownership. The ASF licenses this file | 
 | 10 | to you under the Apache License, Version 2.0 (the | 
 | 11 | "License"); you may not use this file except in compliance | 
 | 12 | with the License. You may obtain a copy of the License at | 
 | 13 |  | 
 | 14 |   http://www.apache.org/licenses/LICENSE-2.0 | 
 | 15 |  | 
 | 16 | Unless required by applicable law or agreed to in writing, | 
 | 17 | software distributed under the License is distributed on an | 
 | 18 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | 
 | 19 | KIND, either express or implied. See the License for the | 
 | 20 | specific language governing permissions and limitations | 
 | 21 | under the License. | 
 | 22 |  | 
 | 23 | Using Thrift with C++ | 
 | 24 | ===================== | 
 | 25 |  | 
 | 26 | You need to define an enviroment variable called THIRD_PARTY. The project | 
 | 27 | assumes that you have extracted the dependancies into their default structure | 
 | 28 | into the path defined by THIRD_PARTY. | 
 | 29 |  | 
 | 30 | e.g. $(THIRD_PARTY)/boost/boost_1_47_0/ | 
 | 31 |  | 
 | 32 | Thrift is divided into two libraries. | 
 | 33 |  | 
 | 34 | libthrift | 
 | 35 |   The core Thrift library contains all the core Thrift code. It requires | 
| Roger Meier | 878a948 | 2011-10-11 19:02:37 +0000 | [diff] [blame] | 36 |   boost shared pointers and boost thread. | 
| Roger Meier | 84e4a3c | 2011-09-16 20:58:44 +0000 | [diff] [blame] | 37 |  | 
 | 38 | libthriftnb | 
 | 39 |   This library contains the Thrift nonblocking server, which uses libevent. | 
 | 40 |   To link this library you will also need to link libevent. | 
 | 41 |  | 
 | 42 | You MUST apply this patch to make generated code compile. | 
 | 43 | https://issues.apache.org/jira/browse/THRIFT-1139 | 
 | 44 |  | 
 | 45 | Linking Against Thrift | 
 | 46 | ====================== | 
 | 47 |  | 
 | 48 | You need to link your project that uses thrift against all the thrift | 
| Roger Meier | 878a948 | 2011-10-11 19:02:37 +0000 | [diff] [blame] | 49 | dependancies; in the case of libthrift, boost and for | 
| Roger Meier | 84e4a3c | 2011-09-16 20:58:44 +0000 | [diff] [blame] | 50 | libthriftnb, libevent. | 
 | 51 |  | 
 | 52 | In the project properties you must also set HAVE_CONFIG_H as force include | 
 | 53 | the config header: "windows/confg.h" | 
 | 54 |  | 
 | 55 | Dependencies | 
 | 56 | ============ | 
 | 57 |  | 
 | 58 | boost shared pointers | 
 | 59 | http://www.boost.org/libs/smart_ptr/smart_ptr.htm | 
 | 60 |  | 
| Roger Meier | 878a948 | 2011-10-11 19:02:37 +0000 | [diff] [blame] | 61 | boost thread | 
 | 62 | http://www.boost.org/doc/libs/release/doc/html/thread.html | 
 | 63 |  | 
| Roger Meier | 84e4a3c | 2011-09-16 20:58:44 +0000 | [diff] [blame] | 64 | libevent (for libthriftnb only) | 
 | 65 | http://monkey.org/~provos/libevent/ | 
 | 66 |  | 
| Roger Meier | 878a948 | 2011-10-11 19:02:37 +0000 | [diff] [blame] | 67 | Notes on boost thread (static vs shared): | 
 | 68 | ========================================= | 
 | 69 |  | 
 | 70 | By default lib/cpp/windows/force_inc.h defines: | 
 | 71 |  | 
 | 72 | #define BOOST_ALL_NO_LIB 1 | 
 | 73 | #define BOOST_THREAD_NO_LIB 1 | 
 | 74 |  | 
 | 75 | This has for effect to have the host application linking against Thrift | 
 | 76 | to have to link with boost thread as a static library. | 
 | 77 |  | 
 | 78 | If you wanted instead to link with boost thread as a shared library, | 
 | 79 | you'll need to uncomment those two lines, and recompile. | 
| Roger Meier | 84e4a3c | 2011-09-16 20:58:44 +0000 | [diff] [blame] | 80 |  | 
 | 81 | Known issues | 
 | 82 | ============ | 
 | 83 |  | 
| Roger Meier | 84e4a3c | 2011-09-16 20:58:44 +0000 | [diff] [blame] | 84 | - Does not support named pipes. (Supported in unix through unix domain sockets). | 
 | 85 |  | 
 | 86 | TODO | 
 | 87 | ==== | 
 | 88 |  | 
 | 89 | - Port remaining classes in libthrift: | 
| Roger Meier | 84e4a3c | 2011-09-16 20:58:44 +0000 | [diff] [blame] | 90 |     - TSSLSocket | 
 | 91 |  | 
 | 92 | - Port test cases. (Not even started this. Run test cases in release mode?) | 
 | 93 |  | 
 | 94 | - Autolink libraries depending on debug\release build. | 
 | 95 |  | 
 | 96 | - Auto versioning. |