• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Creating dynamic and static libs from one target
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating dynamic and static libs from one target


  • Subject: Re: Creating dynamic and static libs from one target
  • From: Scott Tooker <email@hidden>
  • Date: Wed, 2 Nov 2005 09:52:37 -0800


On Nov 2, 2005, at 4:54 AM, Andreas Grosam wrote:


On 01.11.2005, at 21:18, eduard mueller wrote:

Hi Andreas,


Andreas Grosam wrote:


On 01.11.2005, at 03:11, eduard wrote:

[...]


Maybe this might work:

1) Create a custom Configuration file for your project, say MyDylibSet.xcconfig. (see Xcode help how to accomplish this)

2) For each library, in the info panel of your libraries, for the debug configuration only, make the configuration depend upon your custom config file MyDylibSet.xcconfig

3) Edit the Configuration file such that it contains all required settings to build a dynamic lib, especially set
LIBRARY_STYLE = DYNAMIC and appropriate compiler flags and other settings.
For hints which settings to choose, compare a default dynamic and static build setting. Just drag the value and key which you would like to set in your custom file from within the Info Panel into your custom config file in order to get key and values pairs as text.


4) In the target info panel of your library **delete** all settings which you added in the assigned Configuration file. This is necessary, because the target settings would otherwise still override the custom configuration settings.


Yes, thats how we already have done it. There are four configurations, all only based on
xcconfig files only: Debug, Release, DebugDynlib, ReleaseDynlib


The problem is, that setting LIBRARY_STYLE to DYNAMIC seems to have no effect at all.
The way how the .o`s are linked together seems to be only specified by the "productType" property of
the target, which can not be modified via configuration settings. (try a search in the pbxproj file
for for example "productType = "com.apple.product- type.library.static";").

I also feared, that something like this might happen, due to the internal build system.



When setting the LIBRARY_STYLE has no effect - this seems to be a bug. It looks like, that the build system makes decisions upon the type of products, although there are build settings for a target which should be taken into account.


I would suggest to file a feature or bug report to Apple.

I would also appreciate if an Apple Xcode developer could clarify this issue briefly.

Currently, you can't have one target produce a static library or dynamic library using configurations (i.e. there is no build setting that determines what sort of product is produced).


Ah, but what about LIBRARY_STYLE, you ask? Well LIBRARY_STYLE is completely broken in Xcode 2.1. WE've fixed this in the next version of Xcode by allowing you to indicate what sort of Mach-O binary a product contains via a new build setting (LIBRARY_STYLE has been removed), but that isn't what you want.

For now, you'll need to use two different targets.

Scott



Regards
Andreas


As said before, adjusting also EXECUTABLE_PREFIX and EXECUTABLE_EXTENSION and then passing "-dynamic"
via OTHER_LDFLAGS somehow works, but feel like a big hack.


If you want to modify or extend the custom settings in the info panel of the target settings, use this syntax:

In the Info Panel:
KEY    $(value) extension

which in this case, adds the value "extension" to the existing setting represented by the variable "value", which is the value of the base configuration file. For the Debug Configuration, this is your value set in the custom config file.
Notice, that the name of the base value is literally "value".



Thanks for the "$(value)" trick! I wasnt aware of this one. This will safe a lot of copy and pasting :)

You have to thank Scott Tooker from Apple who obviously knows every nice trick ;-)





Greets,
eduard
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40onlinehome.de


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Creating dynamic and static libs from one target
      • From: eduard mueller <email@hidden>
References: 
 >Re: Creating dynamic and static libs from one target (From: Andreas Grosam <email@hidden>)
 >Re: Creating dynamic and static libs from one target (From: eduard mueller <email@hidden>)
 >Re: Creating dynamic and static libs from one target (From: Andreas Grosam <email@hidden>)

  • Prev by Date: Re: preprocess Info.plist
  • Next by Date: Quoting Framework Search Paths
  • Previous by thread: Re: Creating dynamic and static libs from one target
  • Next by thread: Re: Creating dynamic and static libs from one target
  • Index(es):
    • Date
    • Thread