0

how can i remove the source code from my static library with XCode 4? When i have Xcode 3 in target there is the list of source and i can delete them, but with XCode 4 the target is not expandable...

Can i do olso with some libtool?

Thansk!

ldav1s
  • 15,885
  • 2
  • 53
  • 56
Luciano Salemme
  • 387
  • 2
  • 15
  • Do you have the library open in another project? I found that if it's open in more than one place, it can't be expanded. When I closed all other projects that used it (including the library project alone), the source could be expanded in the one remaining open project. – Jim Nov 29 '11 at 20:49
  • If i have only my library project open the target is not expandable too... even in XCode 4 i never see expandable target so may be there is another solution that i'm looking for... – Luciano Salemme Nov 30 '11 at 10:50

3 Answers3

1

Not sure to understand what you mean, but if you want to remove symbols from a binary/library, you should use the strip command.

A static library is not source code, it's machine code.
You can't have access to the source files, if you only have a static library.

Otherwise, if you meant "target" instead of library, meaning you are actually building a library with Xcode, and you want that specific source files don't compile into the library, use the "Target membership" section on the Xcode right panel (utilities).

When you select the file, you can set the target for the source file:

enter image description here

Macmade
  • 52,708
  • 13
  • 106
  • 123
  • I want write a static library for my customer and when i compile the libXXX.a file i realize that my source code goes into libXXX.a... but i must supply only compiled code... – Luciano Salemme Nov 30 '11 at 10:31
  • I don't understand... A static library does NOT contain source code, as I've said. Try to reveal the libXXX.a file in the Finder. You'll see it's only compiled code. – Macmade Nov 30 '11 at 10:36
  • mmm... i say that because in my test project of the library, when there is an error on the libXXX.a the debugger show my static library source code, so when i deliver the library to my customer if there is an error his xcode debugger show my source code??? – Luciano Salemme Nov 30 '11 at 10:48
  • No... You are seeing this because Xcode is able, while debugging, to map the symbols of the library to your source code. But if you don't have the sources, the only thing you can get from the .a file with a debugger like GDB is assembly code. So don't worry. – Macmade Nov 30 '11 at 11:03
  • Ok so i'm able to see the source code, but my customer son't see noting? right? – Luciano Salemme Nov 30 '11 at 12:30
  • If you distribute only the libXXX.a file, yes. – Macmade Nov 30 '11 at 12:34
0

Under build settings for the static library target, select NO for 'deployment postprocessing' and 'strip debug symbols during copy'. It is compiled code so it doesn't need symbols stripped.

donnadupuis
  • 91
  • 1
  • 2
0

I'm assuming that you have the library sources added to the project and you want to remove them from a specific target. Select the project (the top level item on the left side), select the target under "Targets", click "Build Phases" and remove the respective items from "Compile Sources".

pmf
  • 577
  • 4
  • 14