[CMake] Specify 32-bit compilation to Clang

Robert Dailey rcdailey.lists at gmail.com
Sat Jan 24 18:43:59 EST 2015


Where are these variables documented? I haven't seen them anywhere.
Also is this required? I'd rather the CMake script itself specify that
32-bit compilation is needed, since the code itself does not compile
properly in 64-bit environment.

On Mon, Jan 19, 2015 at 1:48 PM, Gregor Jasny <gjasny at googlemail.com> wrote:
> 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