Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2170)

Unified Diff: build/toolchain/mac/BUILD.gn

Issue 2387723002: Test CL to demonstrate GN + hermetic toolchain
Patch Set: more fixes. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/secondary/third_party/crashpad/crashpad/util/BUILD.gn ('k') | build/toolchain/toolchain.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain/mac/BUILD.gn
diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn
index 0c00e995fffe139ac39badd12790acbad3a78a7a..31a5419a2ee807d012a13544ee87c5960ad18e8b 100644
--- a/build/toolchain/mac/BUILD.gn
+++ b/build/toolchain/mac/BUILD.gn
@@ -62,6 +62,7 @@ tool_versions =
# build args in this definition.
template("mac_toolchain") {
toolchain(target_name) {
+ env_wrapper = "export DEVELOPER_DIR=$hermetic_xcode_path; " # Note trailing space.
# When invoking this toolchain not as the default one, these args will be
# passed to the build. They are ignored when this is the default toolchain.
assert(defined(invoker.toolchain_args),
@@ -157,7 +158,7 @@ template("mac_toolchain") {
tool("cc") {
depfile = "{{output}}.d"
precompiled_header_type = "gcc"
- command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
+ command = "$env_wrapper $cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}"
depsformat = "gcc"
description = "CC {{output}}"
outputs = [
@@ -168,7 +169,7 @@ template("mac_toolchain") {
tool("cxx") {
depfile = "{{output}}.d"
precompiled_header_type = "gcc"
- command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}"
+ command = "$env_wrapper $cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}"
depsformat = "gcc"
description = "CXX {{output}}"
outputs = [
@@ -179,7 +180,7 @@ template("mac_toolchain") {
tool("asm") {
# For GCC we can just use the C compiler to compile assembly.
depfile = "{{output}}.d"
- command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{asmflags}} -c {{source}} -o {{output}}"
+ command = "$env_wrapper $cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{asmflags}} -c {{source}} -o {{output}}"
depsformat = "gcc"
description = "ASM {{output}}"
outputs = [
@@ -190,7 +191,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 = "$env_wrapper $cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_objc}} -c {{source}} -o {{output}}"
depsformat = "gcc"
description = "OBJC {{output}}"
outputs = [
@@ -201,7 +202,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 = "$env_wrapper $cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_objcc}} -c {{source}} -o {{output}}"
depsformat = "gcc"
description = "OBJCXX {{output}}"
outputs = [
@@ -212,7 +213,7 @@ template("mac_toolchain") {
tool("alink") {
script =
rebase_path("//build/toolchain/mac/filter_libtool.py", root_build_dir)
- command = "rm -f {{output}} && TOOL_VERSION=${tool_versions.filter_libtool} python $script libtool -static {{arflags}} -o {{output}} {{inputs}}"
+ command = "$env_wrapper rm -f {{output}} && TOOL_VERSION=${tool_versions.filter_libtool} python $script libtool -static {{arflags}} -o {{output}} {{inputs}}"
description = "LIBTOOL-STATIC {{output}}"
outputs = [
"{{output_dir}}/{{target_output_name}}{{output_extension}}",
@@ -240,7 +241,7 @@ template("mac_toolchain") {
does_reexport_command = "[ ! -e \"$dylib\" -o ! -e \"$tocname\" ] || otool -l \"$dylib\" | grep -q LC_REEXPORT_DYLIB"
- link_command = "$linker_driver $ld -shared "
+ link_command = "$env_wrapper $linker_driver $ld -shared "
if (is_component_build) {
link_command += " -Wl,-install_name,@rpath/\"{{target_output_name}}{{output_extension}}\" "
}
@@ -291,7 +292,7 @@ template("mac_toolchain") {
rspfile = sofile + ".rsp"
pool = "//build/toolchain:link_pool($default_toolchain)"
- link_command = "$linker_driver $ld -bundle {{ldflags}} -o \"$sofile\" -Wl,-filelist,\"$rspfile\""
+ link_command = "$env_wrapper $linker_driver $ld -bundle {{ldflags}} -o \"$sofile\" -Wl,-filelist,\"$rspfile\""
if (is_component_build) {
link_command += " -Wl,-install_name,@rpath/{{target_output_name}}{{output_extension}}"
}
@@ -334,7 +335,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 = "$env_wrapper $linker_driver $ld $dsym_switch {{ldflags}} -o \"$outfile\" -Wl,-filelist,\"$rspfile\" {{solibs}} {{libs}}"
description = "LINK $outfile"
rspfile_content = "{{inputs_newline}}"
outputs = [
@@ -400,7 +401,7 @@ template("mac_toolchain") {
_sdk_name = mac_sdk_name
_min_deployment_target = mac_deployment_target
}
- command = "rm -f {{output}} && " +
+ command = "$env_wrapper rm -f {{output}} && " +
"TOOL_VERSION=${tool_versions.compile_xcassets} " +
"python $_tool -p $_sdk_name -t $_min_deployment_target " +
"-T {{bundle_product_type}} -o {{output}} {{inputs}}"
« no previous file with comments | « build/secondary/third_party/crashpad/crashpad/util/BUILD.gn ('k') | build/toolchain/toolchain.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698