-
Notifications
You must be signed in to change notification settings - Fork 78
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
How to link with a framework on macOS ? #393
Comments
It sounds like |
Yeah. Liblist keeps being a PITA. |
Workaround: Add a library (e.g.
ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm Lines 274 to 279 in ff859c3
Gaining knowledge: It might be that the standard paths get searched - from Including Frameworks
and possibly diff --git a/lib/ExtUtils/Liblist/Kid.pm b/lib/ExtUtils/Liblist/Kid.pm
index 5eb8a8a0..3fd56e4b 100644
--- a/lib/ExtUtils/Liblist/Kid.pm
+++ b/lib/ExtUtils/Liblist/Kid.pm
@@ -97,6 +97,12 @@ sub _unix_os2_ext {
}
if ( $thislib =~ m!^-Wl,! ) {
+ if (@extralibs && $extralibs[$#extralibs] eq '-Wl,-framework') {
+ (my $framework = $thislib) =~ s/^-Wl,//;
+ for (qw(/System/Library/Frameworks /Library/Frameworks), split(/:/, $ENV{DYLD_FRAMEWORK_PATH})) {
+ $found++ if (-d File::Spec->catdir($_, "$framework.framework"));
+ }
+ }
push( @extralibs, $thislib );
push( @ldloadlibs, $thislib );
next; |
See this question on stackoverflow. In order to compile the following C program on macOS :
the following command line can be used:
But passing
LIBS => " -framework ApplicationServices"
toWriteMakefile()
does not work. For example:However, passing
LDDLFLAGS => "$Config{lddlflags} -framework ApplicationServices"
does work, but shouldn't it be possible to useLIBS
here ?The text was updated successfully, but these errors were encountered: