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

Side by Side Diff: build/config/compiler/BUILD.gn

Issue 116803003: Add support for sysroots to GN's pkg-config. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | build/config/linux/pkg-config.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/linux/sysroot.gni") 5 import("//build/config/linux/sysroot.gni")
6 6
7 # Base compiler configuration. 7 # Base compiler configuration.
8 config("compiler") { 8 config("compiler") {
9 include_dirs = [ "//", root_gen_dir ] 9 include_dirs = [ "//", root_gen_dir ]
10 if (is_win) { 10 if (is_win) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 ] 76 ]
77 } else { 77 } else {
78 # Non-Mac Posix compiler flags setup. 78 # Non-Mac Posix compiler flags setup.
79 # ----------------------------------- 79 # -----------------------------------
80 80
81 # CPU architecture. We may or may not be doing a cross compile now, so for 81 # CPU architecture. We may or may not be doing a cross compile now, so for
82 # simplicity we always explicitly set the architecture. 82 # simplicity we always explicitly set the architecture.
83 if (cpu_arch == "x64") { 83 if (cpu_arch == "x64") {
84 cflags += "-m64" 84 cflags += "-m64"
85 ldflags += "-m64" 85 ldflags += "-m64"
86 } else if (cpu_arch == "x32") { 86 } else if (cpu_arch == "x86") {
87 cflags += "-m32" 87 cflags += "-m32"
88 ldflags += "-m32" 88 ldflags += "-m32"
89 } 89 }
90 } 90 }
91 91
92 # Linux-specific compiler flags setup. 92 # Linux-specific compiler flags setup.
93 # ------------------------------------ 93 # ------------------------------------
94 if (is_linux) { 94 if (is_linux) {
95 cflags += [ 95 cflags += [
96 "-fPIC", 96 "-fPIC",
(...skipping 21 matching lines...) Expand all
118 # Only apply this to the target linker, since the host 118 # Only apply this to the target linker, since the host
119 # linker might not be gold, but isn't used much anyway. 119 # linker might not be gold, but isn't used much anyway.
120 "-Wl,--threads", 120 "-Wl,--threads",
121 "-Wl,--thread-count=4", 121 "-Wl,--thread-count=4",
122 ] 122 ]
123 } 123 }
124 124
125 if (sysroot != "") { 125 if (sysroot != "") {
126 cflags += "--sysroot=" + sysroot 126 cflags += "--sysroot=" + sysroot
127 ldflags += "--sysroot=" + sysroot 127 ldflags += "--sysroot=" + sysroot
128
129 # Need to get some linker flags out of the sysroot.
130 ldflags += exec_script("../linux/sysroot_ld_path.py",
131 [rebase_path("../../linux/sysroot_ld_path.sh", ".", root_build_dir),
132 sysroot],
133 "value")
128 } 134 }
129 135
130 ldflags += [ 136 ldflags += [
131 "-fPIC", 137 "-fPIC",
132 "-pthread", 138 "-pthread",
133 "-Wl,-z,noexecstack", 139 "-Wl,-z,noexecstack",
134 "-Wl,-z,now", 140 "-Wl,-z,now",
135 "-Wl,-z,relro", 141 "-Wl,-z,relro",
136 ] 142 ]
137 } 143 }
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 } else { 415 } else {
410 cflags = [ "-g1" ] 416 cflags = [ "-g1" ]
411 } 417 }
412 } 418 }
413 419
414 config("no_symbols") { 420 config("no_symbols") {
415 if (!is_win) { 421 if (!is_win) {
416 cflags = [ "-g0" ] 422 cflags = [ "-g0" ]
417 } 423 }
418 } 424 }
OLDNEW
« no previous file with comments | « no previous file | build/config/linux/pkg-config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698