[CMake] OS X Universal Binary follow up

William A. Hoffman billlist at nycap.rr.com
Thu Dec 22 10:54:35 EST 2005


At 11:29 PM 12/21/2005, E. Wing wrote:
>I double checked the build flags from Bob's page. I think some
>adjustments are in order.
>I whipped up a small example attached to this message.
>
>In the link flags, having both sysroot and syslibroot defined gave me errors.
>
>Apple has some docs which seems to back not using sysroot in the link flags.
>http://developer.apple.com/technotes/tn2005/tn2137.html
>
>http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/index.html?http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/compiling/chapter_4_section_3.html
>
>
>Also, it seemed that I had to specify the target architectures for
>both the compile and link flags. This isn't mentioned in the docs and
>might just be a byproduct of how I set up the Makefile. When I didn't
>specify the target arch in the link flags, when I checked the final
>testapp binary with "lipo -info", it was not a fat binary even though
>the .o file was.

One thing you could try is to use Xcode to build a universal binary.
Then look at the verbose build output, by running xcodebuild >& build.log
from the command line.   Then we can find out exactly what flags to use.

-Bill



More information about the CMake mailing list