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

Side by Side Diff: build/toolchain/win/BUILD.gn

Issue 2385643004: Enables GN build on windows (Closed)
Patch Set: Add .gitignore for build Created 4 years, 2 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 unified diff | Download patch
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 declare_args() { 5 declare_args() {
6 # Path to the directory containing the VC binaries for the right 6 # Path to the directory containing the VC binaries for the right
7 # combination of host and target architectures. Currently only the 7 # combination of host and target architectures. Currently only the
8 # 64-bit host toolchain is supported, with either 32-bit or 64-bit targets. 8 # 64-bit host toolchain is supported, with either 32-bit or 64-bit targets.
9 # If vc_bin_dir is not specified on the command line (and it normally 9 # If vc_bin_dir is not specified on the command line (and it normally
10 # isn't), we will dynamically determine the right value to use at runtime. 10 # isn't), we will dynamically determine the right value to use at runtime.
11 vc_bin_dir = "" 11 vc_bin_dir = ""
12 } 12 }
13 13
14 import("//build/config/win/visual_studio_version.gni") 14 import("//build/config/win/visual_studio_version.gni")
15 import("//build/toolchain/goma.gni") 15 import("//build/toolchain/goma.gni")
16 16
17 # Should only be running on Windows. 17 # Should only be running on Windows.
18 assert(is_win) 18 assert(is_win)
19 19
20 # Setup the Visual Studio state. 20 # Setup the Visual Studio state.
21 # 21 #
22 # Its arguments are the VS path and the compiler wrapper tool. It will write 22 # Its arguments are the VS path and the compiler wrapper tool. It will write
23 # "environment.x86" and "environment.x64" to the build directory and return a 23 # "environment.x86" and "environment.x64" to the build directory and return a
24 # list to us. 24 # list to us.
25 gyp_win_tool_path = 25 gyp_win_tool_path =
26 rebase_path("//tools/gyp/pylib/gyp/win_tool.py", root_build_dir) 26 rebase_path("//third_party/gyp/pylib/gyp/win_tool.py", root_build_dir)
27 27
28 toolchain_data = exec_script("setup_toolchain.py", 28 toolchain_data = exec_script("setup_toolchain.py",
29 [ 29 [
30 visual_studio_path, 30 visual_studio_path,
31 gyp_win_tool_path, 31 gyp_win_tool_path,
32 windows_sdk_path, 32 windows_sdk_path,
33 visual_studio_runtime_dirs, 33 visual_studio_runtime_dirs,
34 current_cpu, 34 current_cpu,
35 ], 35 ],
36 "scope") 36 "scope")
37 37
38 if (vc_bin_dir == "") { 38 if (vc_bin_dir == "") {
39 vc_bin_dir = toolchain_data.vc_bin_dir 39 vc_bin_dir = toolchain_data.vc_bin_dir
40 } 40 }
41 41
42 if (use_goma) { 42 if (use_goma) {
43 goma_prefix = "$goma_dir/gomacc.exe " 43 goma_prefix = "$goma_dir/gomacc.exe "
44 } else { 44 } else {
45 goma_prefix = "" 45 goma_prefix = ""
46 } 46 }
47 47
48 # This value will be inherited in the toolchain below.
49 concurrent_links = exec_script("../get_concurrent_links.py", [], "value")
50
51 # Parameters: 48 # Parameters:
52 # current_cpu: current_cpu to pass as a build arg 49 # current_cpu: current_cpu to pass as a build arg
53 # environment: File name of environment file. 50 # environment: File name of environment file.
54 template("msvc_toolchain") { 51 template("msvc_toolchain") {
55 if (defined(invoker.concurrent_links)) {
56 concurrent_links = invoker.concurrent_links
57 }
58
59 env = invoker.environment 52 env = invoker.environment
60 53
61 if (is_debug) { 54 if (is_debug) {
62 configuration = "Debug" 55 configuration = "Debug"
63 } else { 56 } else {
64 configuration = "Release" 57 configuration = "Release"
65 } 58 }
66 exec_script("../../vs_toolchain.py", 59 exec_script("../../vs_toolchain.py",
67 [ 60 [
68 "copy_dlls", 61 "copy_dlls",
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 } 191 }
199 192
200 tool("copy") { 193 tool("copy") {
201 command = 194 command =
202 "$python_path gyp-win-tool recursive-mirror {{source}} {{output}}" 195 "$python_path gyp-win-tool recursive-mirror {{source}} {{output}}"
203 description = "COPY {{source}} {{output}}" 196 description = "COPY {{source}} {{output}}"
204 } 197 }
205 198
206 # When invoking this toolchain not as the default one, these args will be 199 # When invoking this toolchain not as the default one, these args will be
207 # passed to the build. They are ignored when this is the default toolchain. 200 # passed to the build. They are ignored when this is the default toolchain.
208 toolchain_args() { 201 toolchain_args = {
209 current_cpu = invoker.current_cpu 202 current_cpu = invoker.current_cpu
210 if (defined(invoker.is_clang)) { 203 if (defined(invoker.is_clang)) {
211 is_clang = invoker.is_clang 204 is_clang = invoker.is_clang
212 } 205 }
213 } 206 }
214 } 207 }
215 } 208 }
216 209
217 # TODO(dpranke): Declare both toolchains all of the time when we 210 # TODO(dpranke): Declare both toolchains all of the time when we
218 # get it sorted out how we want to support them both in a single build. 211 # get it sorted out how we want to support them both in a single build.
(...skipping 25 matching lines...) Expand all
244 } 237 }
245 msvc_toolchain("clang_x64") { 238 msvc_toolchain("clang_x64") {
246 environment = "environment.x64" 239 environment = "environment.x64"
247 current_cpu = "x64" 240 current_cpu = "x64"
248 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", 241 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin",
249 root_build_dir) 242 root_build_dir)
250 cl = "${goma_prefix}$prefix/clang-cl.exe" 243 cl = "${goma_prefix}$prefix/clang-cl.exe"
251 is_clang = true 244 is_clang = true
252 } 245 }
253 } 246 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698