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

Unified Diff: tools/gn.py

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 side-by-side diff with in-line comments
Download patch
Index: tools/gn.py
diff --git a/tools/gn.py b/tools/gn.py
index 37aa885d1ec8983fe5ccf61d515b7e577369eb62..2cef91cd982dd52e4e4afa8fd0f3f303b566fb6f 100755
--- a/tools/gn.py
+++ b/tools/gn.py
@@ -45,12 +45,17 @@ def target_cpu_for_arch(arch, os):
return 'arm64' if os == 'android' else 'x64'
return arch
+def host_os_for_gn(os):
+ if os.startswith('macos'):
+ return 'mac'
+ if os.startswith('win'):
+ return 'win'
+ return os
+
def to_gn_args(args):
gn_args = {}
- host_os = HOST_OS
- if HOST_OS == 'macos':
- host_os = 'mac'
+ host_os = host_os_for_gn(HOST_OS)
if args.os == 'host':
gn_args['target_os'] = host_os
else:
@@ -63,8 +68,11 @@ def to_gn_args(args):
# TODO(zra): This is for the observatory, which currently builds using the
# checked-in sdk. If/when the observatory no longer builds with the
# checked-in sdk, this can be removed.
+ pub = 'pub'
+ if host_os == 'win':
+ pub = pub + ".bat"
gn_args['dart_host_pub_exe'] = os.path.join(
- DART_ROOT, 'tools', 'sdks', host_os, 'dart-sdk', 'bin', 'pub')
+ DART_ROOT, 'tools', 'sdks', host_os, 'dart-sdk', 'bin', pub)
# For Fuchsia support, the default is to not compile in the root
# certificates.
@@ -84,7 +92,10 @@ def to_gn_args(args):
# 'is_debug', 'is_release' and 'is_product'.
gn_args['dart_runtime_mode'] = 'develop'
- gn_args['is_clang'] = args.clang and args.os not in ['android']
+ if host_os == 'win':
+ gn_args['is_clang'] = False
+ else:
+ gn_args['is_clang'] = args.clang and args.os not in ['android']
if args.target_sysroot:
gn_args['target_sysroot'] = args.target_sysroot
« no previous file with comments | « tools/find_depot_tools.py ('k') | utils/invoke_dart.gni » ('j') | utils/invoke_dart.gni » ('J')

Powered by Google App Engine
This is Rietveld 408576698