ユニバーサルバイナリを作る時は、
メニューの「プロジェクト」「プロジェクト設定を編集」を開きます。
初期設定は、ビルドしたアーキテクチャになっているので、
「アーキテクチャ」を選択して「編集」をクリックして、「intel」にチェックを入れます。
このように設定が変わります。
再度 Build します。
ibg4:~/helloworld/build/Debug kenz$ ls -la
total 160
drwxr-xr-x 3 kenz kenz 102 Apr 1 22:22 .
drwxr-xr-x 4 kenz kenz 136 Apr 1 22:13 ..
-rwxr-xr-x 1 kenz kenz 78972 Apr 1 22:22 helloworld
ibg4:~/helloworld/build/Debug kenz$ file helloworld
helloworld: Mach-O fat file with 2 architectures
helloworld (for architecture ppc): Mach-O executable ppc
helloworld (for architecture i386): Mach-O executable i386
ibg4:~/helloworld/build/Debug kenz$
ibg4:~/helloworld/build/Debug kenz$ ./helloworld
Hello, World!
ibg4:~/helloworld/build/Debug kenz$
こんな感じになる。
intel アーキテクチャがないので実行できず。
今度は、intel専用にして Build するとこんな感じ。
ibg4:~/helloworld/build/Debug kenz$ ls -la
total 56
drwxr-xr-x 3 kenz kenz 102 Apr 1 22:24 .
drwxr-xr-x 4 kenz kenz 136 Apr 1 22:13 ..
-rwxr-xr-x 1 kenz kenz 25724 Apr 1 22:24 helloworld
ibg4:~/helloworld/build/Debug kenz$ file helloworld
helloworld: Mach-O executable i386
ibg4:~/helloworld/build/Debug kenz$
ファイルサイズを見ると面白いね。