Skip to content

Commit

Permalink
[ios/mac] Expand {{frameworks}} and {{framework_dirs}} in tools
Browse files Browse the repository at this point in the history
Expand {{frameworks}} and {{framework_dirs}} in tools on iOS
and macOS toolchains in preparation of using the corresponding
attributes in the configs.

Bug: 1052560
Change-Id: Iaaa2656f4cce6581e9904fec38db01f5b3db0799
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2056939
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Olivier Robin <olivierrobin@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#741965}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5ff3526a0e9f0926a70705d8829167f219d730b4
  • Loading branch information
sdefresne authored and Commit Bot committed Feb 17, 2020
1 parent 7cf5a22 commit 62dad5c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions toolchain/mac/BUILD.gn
Expand Up @@ -233,7 +233,7 @@ template("mac_toolchain") {
tool("objc") {
depfile = "{{output}}.d"
precompiled_header_type = "gcc"
command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_objc}} -c {{source}} -o {{output}}"
command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{framework_dirs}} {{cflags}} {{cflags_objc}} -c {{source}} -o {{output}}"
depsformat = "gcc"
description = "OBJC {{output}}"
outputs = [ "$object_subdir/{{source_name_part}}.o" ]
Expand All @@ -242,7 +242,7 @@ template("mac_toolchain") {
tool("objcxx") {
depfile = "{{output}}.d"
precompiled_header_type = "gcc"
command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_objcc}} -c {{source}} -o {{output}}"
command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{framework_dirs}} {{cflags}} {{cflags_objcc}} -c {{source}} -o {{output}}"
depsformat = "gcc"
description = "OBJCXX {{output}}"
outputs = [ "$object_subdir/{{source_name_part}}.o" ]
Expand Down Expand Up @@ -304,7 +304,7 @@ template("mac_toolchain") {
link_command += " -Wl,-install_name,@rpath/\"{{target_output_name}}{{output_extension}}\" "
}
link_command += dsym_switch
link_command += "{{ldflags}} -o \"$dylib\" -Wl,-filelist,\"$rspfile\" {{libs}} {{solibs}}"
link_command += "{{ldflags}} -o \"$dylib\" -Wl,-filelist,\"$rspfile\" {{frameworks}} {{solibs}} {{libs}}"

replace_command = "if ! cmp -s \"$temporary_tocname\" \"$tocname\"; then mv \"$temporary_tocname\" \"$tocname\""
extract_toc_command = "{ $otool -l \"$dylib\" | grep LC_ID_DYLIB -A 5; $nm -gP \"$dylib\" | cut -f1-2 -d' ' | grep -v U\$\$; true; }"
Expand Down Expand Up @@ -356,7 +356,7 @@ template("mac_toolchain") {
link_command += " -Wl,-install_name,@rpath/{{target_output_name}}{{output_extension}}"
}
link_command += dsym_switch
link_command += " {{solibs}} {{libs}}"
link_command += " {{frameworks}} {{solibs}} {{libs}}"
command = link_command

rspfile_content = "{{inputs_newline}}"
Expand Down Expand Up @@ -392,7 +392,7 @@ template("mac_toolchain") {
# do for command-line arguments. Thus any source names with spaces, or
# label names with spaces (which GN bases the output paths on) will be
# corrupted by this process. Don't use spaces for source files or labels.
command = "$linker_driver $ld $dsym_switch {{ldflags}} -o \"$outfile\" -Wl,-filelist,\"$rspfile\" {{solibs}} {{libs}}"
command = "$linker_driver $ld $dsym_switch {{ldflags}} -o \"$outfile\" -Wl,-filelist,\"$rspfile\" {{frameworks}} {{solibs}} {{libs}}"
description = "LINK $outfile"
rspfile_content = "{{inputs_newline}}"
outputs = [ outfile ]
Expand Down

0 comments on commit 62dad5c

Please sign in to comment.