[cmake-developers] Crash bug in XCode generator (2.8.3, 2.8.4-rc1, master)

Johan Björk phb at spotify.com
Thu Jan 27 10:23:40 EST 2011


Hi David,

There are ways to cross compile with Xcode (set the
CMAKE_XCODE_ATTRIBUTE_GCC_VERSION flag). In our setup, we do this from
a toolchain file, even though I'm not sure if it's strictly necessary.

I wouldn't say the behavior is very bug-free though, when creating the
project files, cmake will use the normal CMAKE_XXX_COMPILER flags to
determine if the compiler works, then it will use a different compiler
when doing the XCode tests...

Setting both the xcode attributes and the gcc compiler flags seems to
work pretty well for us, and as a bonus I can use the same toolchain
file on both OSX and Linux =)

Thanks for pushing the fix
/Johan

On Thu, Jan 27, 2011 at 1:20 PM, David Cole <david.cole at kitware.com> wrote:
> Thanks, Johan.
>
> I just committed your patch and pushed it to 'next':
> http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b08657cf0fbe2d02d87a866e7c2dfc29f8d80571
>
> Avoiding crashes. Big fan.
>
> I think all toolchain files are intended for use with only Makefile
> generators at this point... isn't that true? I'm not a big
> cross-compiler yet, but I didn't think toolchain files were intended
> to be used with Xcode or Visual Studio generators.
>
>
> Thanks for the report and the patch!
> David
>
>
> On Thu, Jan 27, 2011 at 4:25 AM, Johan Björk <phb at spotify.com> wrote:
>> Hi everyone,
>>
>> If you specify a CMAKE_TOOLCHAIN_FILE without setting
>> CMAKE_OSX_ARCHITECTURES, you get a crash in
>> cmGlobalXCodeGenerator.cxx:2685.
>> It was a user-error on my behalf (my toolchain file was only intended
>> to be used on Makefile generators), but it's nice if we don't crash.
>>
>> Patch against CMake master  attached.
>>
>> /Johan
>>
>> _______________________________________________
>> cmake-developers mailing list
>> cmake-developers at cmake.org
>> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
>>
>>
>



More information about the cmake-developers mailing list