Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sharedlibtype in xcode4 #1144

Merged
merged 3 commits into from
Aug 1, 2018

Conversation

tempura-sukiyaki
Copy link
Contributor

Add support for CocoaBundle(.bundle) and Framework(.framework).

Copy link
Member

@samsinsane samsinsane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've put down request changes, but it's more for clarification than actual changes.

Loving this XCode work! Do you happen to target iOS too? 😛

@@ -48,7 +48,7 @@
local bundlename = ""
local bundlepath = ""

if cfg.system == p.MACOSX and kind == p.WINDOWEDAPP then
if cfg.system == p.MACOSX and (kind == p.WINDOWEDAPP or (kind == p.SHAREDLIB and cfg.sharedlibtype)) then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be mistaken here, but this will place the DyLib in proj.framework/Contents/MacOS correct? At work the framework I generate doesn't have that path, it's laid out like this:

- Headers/
  - ...
- Versions/
  - A/
    - Headers/
    - <proj dylib>
  - Current/
    - Headers/
    - <proj dylib>
- <proj dylib>

I think the Versions folder is just a bunch of symlinks though. Am I doing it wrong, or are there multiple ways of doing this? I'm certain that I copied an existing Framework when doing this, perhaps it was doing it the old way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right.
I would like to modify it to "proj.framework/Versions/A".
Do you think that is good?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think my hacks at work to generate a Framework did anything special to generate that structure, I believe it was automatically done by XCode. I'll have another look at what I do tomorrow if I get a chance, but you might only need to do this when cfg.system == p.MACOSX and (kind == p.WINDOWEDAPP or (kind == p.SHAREDLIB and cfg.sharedlibtype == "OSXBundle"))? If you have a Mac available you might be able to test this out faster than I can get back to you about what I do. :)

Copy link
Contributor Author

@tempura-sukiyaki tempura-sukiyaki Jul 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

info.bundlepath is a token like %{cfg.buildtarget.bundlepath}, isn't it?

Xcode outputs the entity of dylib to "proj.framework/Versions/A".
And create a symbolic link for dylib in "proj.framework".
"proj.framework/Versions/Current" is a symbolic link for "proj.framework/Versions/A".

As such, when sharedlibtype is OSXFramework, I think it is better to make it "proj.framework/Versions/A".

if cfg.system == p.MACOSX and (kind == p.WINDOWEDAPP or (kind == p.SHAREDLIB and cfg.sharedlibtype)) then
  bundlename = basename .. extension
  bundlepath = path.join(bundlename, iif(kind == p.SHAREDLIB and cfg.sharedlibtype == "OSXFramework", "Versions/A", "Contents/MacOS"))
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm so sorry, I though that these variables were used to output something specific into the XCode project files. I didn't realize it was part of the token system instead, what you're suggesting makes sense!

bundlename = basename .. extension
bundlepath = path.join(bundlename, "Contents/MacOS")
bundlepath = path.join(bundlename, iif(kind == p.SHAREDLIB and cfg.sharedlibtype == "OSXFramework", "Versions/A", "Contents/MacOS"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the indentation went a bit wonky in that last commit.

@samsinsane samsinsane merged commit 11e1126 into premake:master Aug 1, 2018
@tempura-sukiyaki tempura-sukiyaki deleted the xcode4-sharedlibtype branch August 1, 2018 06:15
@starkos
Copy link
Member

starkos commented Aug 1, 2018

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants