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

Unified Diff: build/toolchain/linux/find_android_compilers.py

Issue 117863003: Work on GN toolchain definitions and build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/toolchain/linux/BUILD.gn ('k') | build/toolchain/mac/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain/linux/find_android_compilers.py
diff --git a/build/toolchain/linux/find_android_compilers.py b/build/toolchain/linux/find_android_compilers.py
new file mode 100644
index 0000000000000000000000000000000000000000..7061eccd24f33a5a3f1ccb63b5afe1b03dd6c525
--- /dev/null
+++ b/build/toolchain/linux/find_android_compilers.py
@@ -0,0 +1,31 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This script locates the Android compilers given the bin directory of the
+# android toolchain.
+
+import glob
+import subprocess
+import sys
+
+if len(sys.argv) != 2:
+ print "Error: expecting one argument of the android toolchain dir."
+ sys.exit(1)
+
+# TODO(brettw) this logic seems like a bad idea. It was copied from
+# common.gypi. It seems like the toolchain should just know the name given the
+# current platform rather than having to rely on glob.
+android_toolchain = sys.argv[1]
+cc = glob.glob(android_toolchain + "/*-gcc")
+cxx = glob.glob(android_toolchain + "/*-g++")
+if len(cc) != 1 or len(cxx) != 1:
+ print "Either none or more than one matching compiler."
+ sys.exit(1)
+
+# Get the host compilers from the current path.
+which_gcc = subprocess.check_output(["which gcc"], shell=True).strip()
+which_gxx = subprocess.check_output(["which g++"], shell=True).strip()
+
+print ('["' + cc[0] + '","' + cxx[0] + '","' + which_gcc + '","' +
+ which_gxx + '"]')
« no previous file with comments | « build/toolchain/linux/BUILD.gn ('k') | build/toolchain/mac/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698