You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "James E. King, III (JIRA)" <ji...@apache.org> on 2017/02/08 16:05:41 UTC

[jira] [Commented] (THRIFT-4075) Better MingW support

    [ https://issues.apache.org/jira/browse/THRIFT-4075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15858159#comment-15858159 ] 

James E. King, III commented on THRIFT-4075:
--------------------------------------------

For this patch, do I also need to check __MINGW64__ ?  It looked like __MINGW32__ was not defined in 64-bit builds based on searches I did about MinGW but I could be wrong.

Unfortunately on windows builds we have this windows/config.h which is a bit custom and doesn't follow the rules passed into the make.  Ideally cmake would identify this is MinGW of a particular version and set the right thing in a standard generated config.h.  There's a separate story for this assigned to me that I will get to.  windows/config.h should be removed in favor of having cmake generate one and putting it in the right location.

We should consider having an Appveyor CI build job for MinGW as well as for MSVC (which is what we have now).

> 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)