mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[swift][AutoLinkExtract] Don't add autolink hint for frameworks. (#65051)
Default system linkers on non-Darwin platforms do not support the `-framework` argument for framework linking. This change updates autolinking to not emit `-framework` into the .o _swift1_autolink_entries metadata when there is no native linker support. This is related to rdar://106578342.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
extern int APIFromLinkFramework;
|
||||
@@ -0,0 +1,4 @@
|
||||
framework module Link {
|
||||
umbrella header "Link.h"
|
||||
export *
|
||||
}
|
||||
11
test/AutolinkExtract/import_framework.swift
Normal file
11
test/AutolinkExtract/import_framework.swift
Normal file
@@ -0,0 +1,11 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swiftc_driver -c %s -F %S/Inputs/Frameworks -o %t/import_framework.o
|
||||
// RUN: %target-swift-autolink-extract %t/import_framework.o -o - | %FileCheck --check-prefix CHECK-%target-object-format %s
|
||||
|
||||
// REQUIRES: autolink-extract
|
||||
|
||||
// CHECK-elf-NOT: Link
|
||||
// CHECK-coff-NOT: Link
|
||||
|
||||
import Link
|
||||
_ = Link.APIFromLinkFramework
|
||||
Reference in New Issue
Block a user