Aurelien Regat-Barrel created THRIFT-4075:
---------------------------------------------
Summary: Better MingW support
Key: THRIFT-4075
URL: https://issues.apache.org/jira/browse/THRIFT-4075
Project: Thrift
Issue Type: Improvement
Components: Build Process, C++ - Library
Affects Versions: 0.10.0
Environment: MingW 5.3 / QtCreator (CMake)
Reporter: Aurelien Regat-Barrel
Priority: Trivial
Hello,
I am building Thrift on Windows with QtCreator as a front-end on top of CMake.
I am using MingW 5.3 (Qt 5.7).
I saw that you are working on improving the build experience on Windows with
MingW (#THRIFT-4046) so here are my suggestions :)
- The doc says Boost 1.53 is required, but actually *Boost 1.63 works better*
because they fixed some issues preventing the use of Boost as header only
- I was able to build Thrift with *Boost as header only* with very small
changes. **Boost threads is not required** for MingW 5.3 (it should also work
with MingW 4.9). This makes the build process much simpler because we just have
to unzip the boost package and that's all.
- Therefore you should consider passing *-DWITH_BOOSTTHREADS=OFF* in the
[README-MSYS2.md
doc|https://git-wip-us.apache.org/repos/asf?p=thrift.git;a=blob;f=build/cmake/README-MSYS2.md;h=06c0205056658e743352dabe9fbbc90e1eeaf49e;hb=2d6060d882069ed3e3d6302aa63ea7eb4bb155ad]
- boost/cstdint.hpp is not required (*#define HAVE_STDINT_H*)
Here's the changes I made to
*thrift-0.10.0\lib\cpp\src\thrift\windows\config.h* to better support MingW and
make it possible to use boost as header only.
Since I don't know how to attach a patch here, I'll do it old school :)
Before :
{noformat}
// use std::thread in MSVC11 (2012) or newer
#if _MSC_VER >= 1700
#define USE_STD_THREAD 1
#else
// otherwise use boost threads
#define USE_BOOST_THREAD 1
#endif
// VS2010 or later has stdint.h
#if _MSC_VER >= 1600
#define HAVE_STDINT_H 1
#endif
{noformat}
After :
{noformat}
// use std::thread in MSVC11 (2012) or newer
#if defined(_MSC_VER) && (_MSC_VER >= 1700)
#define USE_STD_THREAD 1
#elif defined(__MINGW32__)
#define USE_STD_THREAD 1
#else
// otherwise use boost threads
#define USE_BOOST_THREAD 1
#endif
// VS2010 or later has stdint.h
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
#define HAVE_STDINT_H 1
#elif defined(__MINGW32__)
#define HAVE_STDINT_H 1
#endif
{noformat}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)