Adding a library to a target - xcode

My documentation says
Click on the target and add pgmName.a on General settings of the
target Info.
I don't see a General settings, although I see Architectures, Build Locations, etc under build settings. And there's an info tab and a summary tab, but I don't see a General settings.

Xcode 4 no longer has this tab setup. You'll want to add pgmName.a to the Link Binary With Libraries step under the Build Phases tab of the target. If you're seeing Info and Summary tabs instead of Build Settings, Build Phases, and Build Rules, click on the target rather than the project in the left panel (under TARGETS rather than PROJECT.)

Related

How can I copy build settings from one target to another

I'm building a project with many individual test programs in it; each test program is its own target.
There are a number of settings that each target in "Build Settings" such as several preprocessor macros, and about half a dozen libraries in the "Build Phases" tab.
Every time I create a new target, I have to manually enter those values all over again. Or I can duplicate an existing target and edit its build sources.
Neither solution is easy. Is there any way to simply copy the build settings from one target to another?
Add a configuration settings file to your project. Choose File > New > File to create a new file. The configuration setting file is in the Other section under iOS or Mac.
Put the build settings you want to copy into the configuration settings file. Select your project from the project editor and click the Info button.
Use the Configurations section to tell Xcode to use your configuration settings file. You can find more detailed information on configuration settings files in the following article:
Xcode Build Configuration Files

Xcode 11, where can I manage Build Phase?

I've migrated my app into Xcode 11.
I want to remove legacy resources that copied at Build Phase, but I can't find old Build Phase menu.
Please make sure that you have selected Target instead of Project.
The problem is that you have the project selected (in the "project and targets list", which may be a collapsed pane for your Xcode).
So first, make sure the button to the far left of the "Info" tab shown in your screenshot is toggled on (so you can see your project and targets list).
Then simply select a target. Now you'll see the Build Phases tab. Only the targets of a project have build phases.
Note: If you don't like to keep the targets list shown, you can simply use the popup menu next to the pane's toggle button - which appears when the pane is not shown - to toggle from project to a target.

Cannot see build phases, general settings in Xcode 6.1

I just downloaded the XCode 6.1 seed.
I am have this issue with one specific project.
The project information view is absolutely different.
The General, Build phases sections are all missing.
All I can see is info and build setting.
Anyone else faced this issue?
None of my other old projects has this issue.
It's a sneaky one - you click the show/hide Project Targets List icon and it pops out the Project name and its targets underneath.
Click one of those and you'll get the Build Phases option showing up.
OP's problem was that the Build Phases did not show up when opening the project settings.
Simple Fix:
Expand the left side bar.
Your project file is selected. (in my case it's called "opengl-series")
This is the problem.
You want to select the App. (in my case "CGTutorial")
Build phases now shows, along with the other settings.

xcconfigs: How to set up multiple configurations for a target

I can't tell from the Xcode UI if my target is using both the Warnings and Pods xcconfigs, or just one.
I've looked at the build log in Xcode, and a search for either xcconfig name comes up empty. How can I tell what's happening behind the scenes?
Xcode's filtered build log shows no results for either configuration file:
The projects are based on "Warnings" and the targets on "Pods". The settings still cascade from project down to target but in this example "Pods" does not apply to any project. Generally I maintain sets of xcconfig files that are best suited to "seed" project settings and separate files suitable for seeding targets.
Also note that build setting propagation occurs separate from a build. Changes to xcconfig files will immediately affect project and target settings. This is why you won't see anything in a build log about them.
Think of all settings for a target build being derived from target settings which may inherit from project settings, which inherit from system default settings. Then independently of that think of xcconfig files as a way of automatically imposing settings at either the project or target level, at a lower priority to manual edits you make in the settings UI.
See? Simple. ;)
Yes, they're inherited.
There's two ways to tell:
Approach a): Look at the build settings for the target.
To find out if Warnings.xcconfig is set up for the RACTest target below:
We select the RACTest target from the dropdown my mouse was over (where that "Select a project or target" hover text is appearing in the first screenshot):
And under the Combined view of All build settings, you'll see the xcconfig listed on the right side:
You'll also see the xcconfig listed under the top-level project target, if you select Build Settings with the project selected:
Approach b): Search the build logs for a property set in your xcconfig.

Build Phase Tab Hidden or Missing

I'm probably asking a very elementary Xcode question, but here it goes. My layout has no 'Build Phase' tab. I might have inadvertently changed my layout. A lot of tutorials state that you should go to the Build Phase tab and link to a library. Well, I've Clicked on the Target, and the File under the Target, Searched the Toolbar, searched the project settings, Info. When I right click on the Target File I get a list including "Copy Build Phase" and Add Build Phase, but that's not giving me access to the Build Phase Tab. I've tried 'reset to default or factory layout'.....Build Phase Tab. How can I display the layout with a Build Phase tab in the toolbar, and save it to utilize in my projects? By the way I'm using XCode 3.2 maybe it's a version limitation?
It sounds like those tutorials are for Xcode 4. For your version, if you open the target in the sidebar, there should be some groups. Those are your build phases. Just drag the library into the one that says something like "Link Executable", or click the checkbox to add it to your target and it should go there automatically.

Resources