-
Notifications
You must be signed in to change notification settings - Fork 0
DevelopingWithXcode
Note: Currently IDE features such as autocomplete and "goto declaration" do not work in Xcode when using a makefile
-
Checkout a version of Cloudy or find the path to a version you already have. Let's assume that it is /Users/username/cloudy
-
Open Xcode. Select New Project from the Welcome Screen or go to File, New, and then New Project on the menu bar.
-
Choose External Build System as the template. It is under Mac OS X_ and _Other. Click Next.
-
Product Name can be whatever you want, I chose Cloudy and I will assume that from now on. Build Tool should point to make. Click Next.
-
Now choose the location where you want to store the Xcode project files. I decided to separate my Cloudy source from the Xcode files. Click Next.
-
In the left pane there should be a blue Xcode project icon called Cloudy.
-
On the menu bar, click File and then Add files to Cloudy. Now you want to choose the Cloudy files. Based on the assumption in Step 1, I would go to /Users/username/cloudy/trunk and select all of the files and folders within. Choose not to Copy items into destination ... and Create folder references ... Click Add.
-
Just left of center on the screen there should be a vertical stripe with a white background. I should contain two sections Project and Targets. Below Targets there should be a target named Cloudy. Make sure it is selected and look to the right.
-
In the right pane, select the Info tab. There should be three textboxes; Build Tool, Arguments, and Directory. Build Tool should point to make still. Arguments should be what you want Xcode to put next to make when it is called (for example Debug). Directory is where the building should occur. Click the icon to the right of the Directory textbox. Assuming that we want to compile with gcc, select the sys_gcc directory. From my assumptions, that would be /Users/username/cloudy/trunk/source/sys_gcc.
-
If you want to use gcc to compile, click the Build Settings tab. Find GCC_VERSION. To use gcc version 4.2, replace com.apple.compilers.llvm.clang.1_0 with 4.2.
-
Now it should be ready to build. Click Product and then Build from the menu bar or use the Command + B keyboard shortcut.
-
Once the build finishes, click Product and Edit Scheme on the menu bar.
-
With Run selected in the left pane of the Edit Scheme window, click the Executable drop-down list and select cloudy.exe.
-
Click View, Debug Area, and Activate Console in the menu bar to see the output console which is where you would type commands when running Cloudy inside Xcode.
- Run Instruments and this should be the first screen you see.
- Make sure that Mac OS X is selected and choose which test you want to run. I will choose Leaks. When you have selected, click Choose.
- Now that Leaks has been chosen, you need to choose a target process or program to watch. Click the Choose Target dropdown.
- The first time through, you will need to click Choose Target two more times. That will open a dialog box which will allow you to find cloudy.exe in the file structure. Since I have used cloudy.exe before, it appears as a recent option.
- When you are ready to run it, click the Record button. That will cause Instruments to run cloudy.exe. It won't get very far since cloudy will stop and wait for console inputs. We will need to quickly switch to the console and enter the commands.
- To switch to the console, click the dropdown menu that says Statistics, then click Console.
- Enter the commands as you normally would, don't forget the extra Enter/Return. Copy and paste works very well for long input files.
Return to DeveloperPages
Return to main [WikiStart wiki] page