question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[feature] Apple platforms - weak frameworks

See original GitHub issue

Conan has convenient way to list frameworks to link against:

self.cpp_info.components["..."].frameworks

Standard way to pass weak framework to linker doesn’t work:

self.cpp_info.components["..."].exelinkflags.append("-weak_framework CoreHaptics")

it’s translated into

-weak_framework  -lCoreHaptics

The only other (and working) way is using -Wl,-weak_framework,CoreHaptics, but it’s rather tedious to type manually.

There can be multiple solutions:

  • extend link flags properties to accept some kind of ArgGroup type
  • add new weak_frameworks property similar to the existing frameworks
  • extend frameworks property to accept some kind of AppleFramework type that would have an is_weak property
  • just create a helper function like linked_weak_framework(framework) that would return f"-Wl,-weak_framework,{framework}"

This was briefly discussed in https://github.com/conan-io/conan-center-index/pull/12472#issuecomment-1224500256 and next comment.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
kambala-decapitatorcommented, Sep 1, 2022

@franramirez688 changed SDL’s test package to use CMakeDeps: yes, you’re absolutely right, it works!

I guess the issue can be closed then?

0reactions
franramirez688commented, Sep 1, 2022

@kambala-decapitator

That’s great news! So glad to hear it!

I guess the issue can be closed then?

Yes, I think so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frameworks and Weak Linking - Apple Developer
Weak Linking and Apple Frameworks​​ Apple wraps new interfaces in its frameworks with availability macros to indicate which version of the ...
Read more >
How to access weak linked framework in iOS? - Stack Overflow
I want to use Twitter framework for iOS 5, but be able to run my app in older OS. I added weak referenced...
Read more >
Add support for weak framework linking (Apple) - GitLab
I just wanted to chime in on how important this issue is. Apple frequently deprecates APIs and adds new ones, usually tied to...
Read more >
Native References iOS, Mac, and Bindings Projects - Xamarin
Native references gives you the ability to embed a native framework into a Xamarin.iOS, Xamarin.Mac, or binding project.
Read more >
How to Weak Link a Lib in iOS? - CoderCrunch
Ios Framework Weaklink In an iOS project you specify a ... Every release of the SDK some new classes and function are added....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found