[CMake] Specify 32-bit compilation to Clang

Gregor Jasny gjasny at googlemail.com
Mon Jan 19 14:48:43 EST 2015


Hello Robert,

On 19/01/15 20:42, Robert Dailey wrote:
> I'm running CMake 3.1 on Mint 64-bit OS. I need to generate an Eclipse
> project using Ninja that uses Clang to build a 32-bit application.
> 
> When I do this:
> 
> add_definitions("-m32")
> 
> For some reason my code is not able to include STL headers (files not
> found). Any reason for this? Is there a more proper way to specify
> 32-bit compilation so STL include paths are set?

You could try setting this two variables at configure time:
-DCMAKE_C_COMPILER_ARG1=-m32 -DCMAKE_CXX_COMPILER_ARG1=-m32

Hope this helps,
Gregpor


More information about the CMake mailing list