Difference between revisions of "Mac OS X"
(→Step Four : Debug v's Release Builds) |
(→Step Four : Debug v's Release Builds) |
||
Line 167: | Line 167: | ||
<div style="text-align: center;"> [[Image:XcodeSetRunToRelease.jpg]] </div> | <div style="text-align: center;"> [[Image:XcodeSetRunToRelease.jpg]] </div> | ||
+ | |||
+ | |||
+ | You can now easily switch between 'Debug' and 'Release' builds using the Scheme Menu. | ||
+ | |||
+ | <div style="text-align: center;"> [[Image:XcodeSwitchDebugRelease.jpg]] </div> | ||
+ | |||
+ | |||
+ | |||
+ | In my case, because I am building directly to the FileMaker Extensions - I have also set Xcode to launch FileMaker once built (when using the Run : Cmd + R option). This means FileMaker is automatically launched once the plugin is built. |
Revision as of 03:32, 21 August 2011
Mac OS X Lion
Mac OS X Lion no longer supports legacy PowerPC applications via Rosetta. In addition, Xcode 4 no longer uses the GCC compiler. At this time, the FileMaker Plugin API requires us to use the GCC 4.0 compiler.
Installing XCode 4 with support for GCC4.0
The following link explains how to install Xcode 4 with the GCC 4.0 compiler, which is necessary to compile FileMaker Plugins.
Step One : Uninstall existing
If you already have Xcode installed, then uninstall it.
sudo <Xcode>/Library/uninstall-devtools --mode=all
Note : It may be necessary to restart your computer after installing Xcode 3 if you have just uninstalled Xcode 4
Step Two : Install Xcode 3
Create a folder 'Xcode3' at the top level of your boot drive. This is where we will install Xcode 3 to (and not the default /Developer location)
To install Xcode 3, mount the Xcode 3.2.x DMG and then enter the following into 'Terminal' :
export COMMAND_LINE_INSTALL=1 open “/Volumes/Xcode and iOS SDK/Xcode and iOS SDK.mpkg”
On the 'Installation Type' screen :
- Change the Location to be the 'Xcode3' folder you created above
- Do not install "System Tools" or "Unix Development"
- Select to install "Mac OS X 10.4 SDK"
Note : Installing the Documentation and/or iOS SDK is optional - install if wanted.
Step Three : Install Xcode 4
Mount the Xcode 4 DMG and Install as normal.
On the 'Installation Type' screen, you should be able to use the default settings.
Step Four : Add GCC4.0 to Xcode 4
Download and run the 'restore-with-xcode3.sh' script, which will add symbolic links within Xcode 4, pointing to Xcode 3.
Execute the code
./restore-with-xcode3.sh
We are now ready to open and use Xcode 4
Opening Project in Xcode 4
Open your project in Xcode 4. The first time you do this, Xcode will index your files.
Step One : Modernise Project
Select your project (on the left) and then click the 'Modernize Project' button at the bottom.
Untick any 'Build Setting' options.
Step Two : Restore PPC & i386 support to project
Select 'Build Settings' for your project, and reset any copiler settings. You'll need to change to 'All' in order to see all options to change.
- Architectures : ppc i386
- Valid Architectures : ppc i386 x86_64
- Build Options : GCC 4.0
Before :
After :
At this point, when should be able to 'Build' our plugin
Step Three : Restore Build Locations
Select XCode Preferences. Then 'Locations'
Click the 'Advanced' button.
Change the 'Build Location' popup to 'Locations Specified by Targets'
For example, I have set my build location to be directly where FileMaker looks for plugins
Step Four : Debug v's Release Builds
Select 'Manage Schemes' from the popup menu right of the stop button (top-left)
Select the first (should be only) scheme and 'Duplicate'.
Rename one scheme as 'Plugin Name (Debug)' and the other as 'Plugin Name (Release)'
Edit the 'Release' scheme.
You can now easily switch between 'Debug' and 'Release' builds using the Scheme Menu.
In my case, because I am building directly to the FileMaker Extensions - I have also set Xcode to launch FileMaker once built (when using the Run : Cmd + R option). This means FileMaker is automatically launched once the plugin is built.