Hi there,

I'm using CMake as part of a workflow on various iOS projects. I have a 
question regarding setting a conditional compiler flag dependent on the 
architecture being compiled:

Apple LLVM causes a serious bug when compiling for older devices that require 
the armv6 architecture. The solution is to disable Thumb support for this 
architecture, but to keep it active for armv7 (using -mno-thumb). A description 
of the compiler issue is here, for those interested: 
http://wanderingcoder.net/2010/07/19/ought-arm/ 

I can set this globally in CMake using: set (CMAKE_C_FLAGS "-mno-thumb"). 
However, I would like to do this only for the armv6 architecture. Setting this 
up through Xcode is easy using a "conditional build setting", see here for 
details: 
http://stackoverflow.com/questions/8390606/is-there-a-way-to-compile-for-arm-rather-than-thumb-in-xcode-4

We use CMake to generate our Xcode projects, and then we work from this 
projects on a daily basis. However, we treat the projects as temporary 
scratchpads and often regenerate them from scratch as part of our workflow. Is 
it possible to mimic this Xcode conditional build setting through my CMake 
configuration so that we don't need to do it manually through Xcode?

Just in case anyone was wondering, iOS app binaries generally contain both 
armv6/7 code, so creating a project for one or the other is not an option.

Any help is greatly appreciated.

James Munro, Programmer, Kwalee Ltd
E: james.mu...@kwalee.com

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to