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

Use frameworks in Premake generator #9371

Merged
merged 1 commit into from
Aug 26, 2021
Merged

Use frameworks in Premake generator #9371

merged 1 commit into from
Aug 26, 2021

Conversation

sheepsteak
Copy link
Contributor

@sheepsteak sheepsteak commented Aug 3, 2021

Fixes #9367

Changelog: Fix: Use frameworks in Premake generator.
Docs: conan-io/docs#2210

This PR allows the system frameworks in a package like SDL2 to now be associated with Premake. There is still the issue with how to use frameworkdirs. It seems like Premake5 does support a framworkdirs property itself but it's only used for the Xcode generator. There is a PR (premake/premake-core#1661) to add this to the gmake generator, however.

Although after looking at the make generator I'm a bit confused about frameworkdirs. The conanbuildinfo.txt has framework_dirs but the make generator (and unit tests) seem to use framework_paths. Are they the same thing?

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

@CLAassistant
Copy link

CLAassistant commented Aug 3, 2021

CLA assistant check
All committers have signed the CLA.

@lasote lasote added this to the 1.40 milestone Aug 4, 2021
@lasote
Copy link
Contributor

lasote commented Aug 4, 2021

Thank you so much for helping with this!! Looks good!
Please, to accept the PR we need you to sign the CLA.

@lasote lasote requested a review from SSE4 August 4, 2021 10:39
@lasote lasote requested a review from uilianries August 4, 2021 10:40
Copy link
Contributor

@SSE4 SSE4 left a comment

Choose a reason for hiding this comment

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

sounds reasonable
this is unfortunate premake doesn't support framework dirs.
we may still populate conan_framework_dirs{dep} vars just in case (someone manually specify -F flags)

@SSE4
Copy link
Contributor

SSE4 commented Aug 4, 2021

Although after looking at the make generator I'm a bit confused about frameworkdirs. The conanbuildinfo.txt has framework_dirs but the make generator (and unit tests) seem to use framework_paths.

frameworkdirs is a value you populate within package_info method, e.g.:

self.cpp_info.frameworkdirs = ['Frameworks']

it's usually a relative paths to your the root directory of your package (theoretically, might be an absolute path as well, but I don't see good use-case for that at the moment)
framework_paths is the final value computed, which is a full, an absolute path to the directory in your local cache. this one is intended to be passed into the compiler/linker, and conan supplies that into generator (thus, files like conanbuildinfo.cmake contain such final paths).

that's more or less the same for other directories:

  • includedirs -> include_paths
  • libdirs -> lib_paths
  • bindirs -> bin_paths
  • resdirs -> res_paths

I think you see the logic, it's just a convention in our CppInfo model.

@uilianries
Copy link
Member

@sheepsteak Thank you for your contribution. Please, don't forget to sign Conan's CLA as described here. Otherwise, this PR could not be merged.

Copy link
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

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

Agreed with @SSE4

The Premake's documentation shows the supported dirs here

Premake doesn't list a frameworkdir, but it also doesn't separate Mac frameworks, instead, it uses links and it's indicated to use absolute path. However, we can consider libdirs in this case.

The framework feature supported by Premake is related to .NET. I hope people don't get confused about it.

Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

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

If I understood this correctly, this will not work for packaged frameworks, only for system frameworks?

Because the frameworks_dir variable is simply not managed, not considered at all here.

@SSE4
Copy link
Contributor

SSE4 commented Aug 23, 2021

If I understood this correctly, this will not work for packaged frameworks, only for system frameworks?

Because the frameworks_dir variable is simply not managed, not considered at all here.

yes. we can do nothing for packaged frameworks, as it's not supported by the build system.

@memsharded
Copy link
Member

yes. we can do nothing for packaged frameworks, as it's not supported by the build system.

Premake doesn't list a frameworkdir, but it also doesn't separate Mac frameworks, instead, it uses links and it's indicated to use absolute path. However, we can consider libdirs in this case.

@uilianries you saying that could in-package frameworks work if the generator provided full paths to the framework somehow?

@uilianries
Copy link
Member

@memsharded if a framework is a single file, yes. But considering link example using Cocoa.Framework and based on old Conan behavior (before 1.22), only the framework name should work, since the DYLD_LIBRARY_PATH is configured correctly.

Well, actually DYLD_FRAMEWORK_PATH should be used, but again Premake doesn't have support for it, instead, it configures the regular DYLD_LIBRARY_PATH only.

@memsharded memsharded merged commit ed76df6 into conan-io:develop Aug 26, 2021
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.

[bug] Premake generator does not use frameworks
7 participants