Skip to content

Commit 1b1a397

Browse files
frobtechcommit-bot@chromium.org
authored andcommitted
[build] Use frameworks instead of libs
Newer GN doesn't allow `*.framework` elements in `libs`. It requires using `frameworks` instead. The toolchain definitions need to pass the new substituted variable to the link to make use of the new required way to express these dependencies. Bug: fxbug.dev/56683 Change-Id: I62e68a8e5bdfef095b72b38d9d41f757e510012b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155482 Auto-Submit: Roland McGrath <[email protected]> Reviewed-by: Ryan Macnak <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent 3fef522 commit 1b1a397

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

build/toolchain/mac/BUILD.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ template("mac_toolchain") {
130130
temporary_tocname = dylib + ".tmp"
131131

132132
does_reexport_command = "[ ! -e $dylib -o ! -e $tocname ] || otool -l $dylib | grep -q LC_REEXPORT_DYLIB"
133-
link_command = "$ld -shared $sysroot_flags $toolchain_flags {{ldflags}} -o $dylib -Wl,-filelist,$rspfile {{solibs}} {{libs}}"
133+
link_command = "$ld -shared $sysroot_flags $toolchain_flags {{ldflags}} -o $dylib -Wl,-filelist,$rspfile {{solibs}} {{libs}} {{frameworks}}"
134134
replace_command = "if ! cmp -s $temporary_tocname $tocname; then mv $temporary_tocname $tocname"
135135
extract_toc_command = "{ otool -l $dylib | grep LC_ID_DYLIB -A 5; nm -gP $dylib | cut -f1-2 -d' ' | grep -v U\$\$; true; }"
136136

@@ -171,7 +171,7 @@ template("mac_toolchain") {
171171
stripped_outfile = "{{root_out_dir}}/exe.stripped/$exename"
172172
}
173173

174-
command = "$ld $sysroot_flags $toolchain_flags {{ldflags}} -Xlinker -rpath -Xlinker @executable_path/Frameworks -o $outfile -Wl,-filelist,$rspfile {{solibs}} {{libs}}"
174+
command = "$ld $sysroot_flags $toolchain_flags {{ldflags}} -Xlinker -rpath -Xlinker @executable_path/Frameworks -o $outfile -Wl,-filelist,$rspfile {{solibs}} {{libs}} {{frameworks}}"
175175
if (defined(invoker.strip)) {
176176
strip = invoker.strip
177177
strip_command = "${strip} -x -o $stripped_outfile $outfile"

runtime/bin/BUILD.gn

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ template("build_gen_snapshot") {
199199
}
200200

201201
if (is_mac) {
202-
libs = [
202+
frameworks = [
203203
"CoreFoundation.framework",
204204
"CoreServices.framework",
205205
]
@@ -445,13 +445,13 @@ template("dart_io") {
445445
defines = []
446446
deps = [ "//third_party/zlib" ] + extra_deps
447447
if (is_mac || is_ios) {
448-
libs = [
448+
frameworks = [
449449
"CoreFoundation.framework",
450450
"Security.framework",
451451
]
452452

453453
if (is_mac) {
454-
libs += [ "CoreServices.framework" ]
454+
frameworks += [ "CoreServices.framework" ]
455455
}
456456
}
457457

0 commit comments

Comments
 (0)