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

Unified Diff: tools/gn/bootstrap/bootstrap.py

Issue 445713002: GN bootstrap.py: fixed cross-compile, etc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/bootstrap/bootstrap.py
diff --git a/tools/gn/bootstrap/bootstrap.py b/tools/gn/bootstrap/bootstrap.py
index 887315409b8e6bcedb962f1832e4b3f8629e3ab9..82e94e505c98721f4a2ca18e88db384d435ae2a6 100755
--- a/tools/gn/bootstrap/bootstrap.py
+++ b/tools/gn/bootstrap/bootstrap.py
@@ -107,6 +107,7 @@ def write_ninja(path, options):
cxx = os.environ.get('CXX', '')
cflags = os.environ.get('CFLAGS', '').split()
cflags_cc = os.environ.get('CXXFLAGS', '').split()
+ ld = os.environ.get('LD', cxx)
ldflags = os.environ.get('LDFLAGS', '').split()
include_dirs = [SRC_ROOT]
libs = []
@@ -117,7 +118,7 @@ def write_ninja(path, options):
else:
cflags.extend(['-O2', '-g0'])
- cflags.extend(['-D_FILE_OFFSET_BITS=64 -pthread', '-pipe'])
+ cflags.extend(['-D_FILE_OFFSET_BITS=64', '-pthread', '-pipe'])
cflags_cc.extend(['-std=gnu++11', '-Wno-c++11-narrowing'])
static_libraries = {
@@ -131,7 +132,7 @@ def write_ninja(path, options):
continue
if name.endswith('_unittest.cc'):
continue
- if name in ['generate_test_gn_data.cc']:
+ if name in ['generate_test_gn_data.cc', 'run_all_unittests.cc']:
continue
full_path = os.path.join(GN_ROOT, name)
static_libraries['gn']['sources'].append(
@@ -377,11 +378,15 @@ def write_ninja(path, options):
ninja_lines.extend([
'build gn: link %s' % (
' '.join(['%s.a' % library for library in static_libraries])),
- ' ld = $ldxx',
' ldflags = %s' % ' '.join(ldflags),
' libs = %s' % ' '.join(libs),
- '', # Make sure the file ends with a newline.
])
+ if ld:
+ ninja_lines.append(' ld = %s' % ld)
+ else:
+ ninja_lines.append(' ld = $ldxx')
+
+ ninja_lines.append('') # Make sure the file ends with a newline.
with open(path, 'w') as f:
f.write(ninja_template + '\n'.join(ninja_lines))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698