diff options
author | michaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-18 22:08:06 +0000 |
---|---|---|
committer | michaelbai@chromium.org <michaelbai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-18 22:08:06 +0000 |
commit | d0245a13c45c5542b51c4eb2c9958c19917e09a7 (patch) | |
tree | e618fe039d733fa1f880dbd583eded8c0def8bf0 /build/compiler_version.py | |
parent | 25320604c11e0313ef5663bff8553b2c9febc9f6 (diff) | |
download | chromium_src-d0245a13c45c5542b51c4eb2c9958c19917e09a7.zip chromium_src-d0245a13c45c5542b51c4eb2c9958c19917e09a7.tar.gz chromium_src-d0245a13c45c5542b51c4eb2c9958c19917e09a7.tar.bz2 |
Removed CXX_target for Android
Don't rely on compiler_version.py, we pass in the gcc_version for Android
Also revert the previous compiler_version.py change.
BUG=143889
Review URL: https://chromiumcodereview.appspot.com/11185059
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162808 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/compiler_version.py')
-rwxr-xr-x | build/compiler_version.py | 49 |
1 files changed, 14 insertions, 35 deletions
diff --git a/build/compiler_version.py b/build/compiler_version.py index eae7b17..b349199 100755 --- a/build/compiler_version.py +++ b/build/compiler_version.py @@ -33,42 +33,21 @@ def GetVersion(compiler): print >> sys.stderr, e return "" -def GetVersionFromEnvironment(compiler_env): - """ Returns the version of compiler - - If the compiler was set by the given environment variable and exists, - return its version, otherwise None is returned. - """ - cxx = os.getenv(compiler_env, None) - if cxx: - cxx_version = GetVersion(cxx) - if cxx_version != "": - return cxx_version - return None - def main(): - # Check if CXX_target or CXX environment variable exists an if it does use - # that compiler. - # TODO: Fix ninja (see http://crbug.com/140900) instead and remove this code - # In ninja's cross compile mode, the CXX_target is target compiler, while - # the CXX is host. The CXX_target needs be checked first, though the target - # and host compiler have different version, there seems no issue to use the - # target compiler's version number as gcc_version in Android. - cxx_version = GetVersionFromEnvironment("CXX_target") - if cxx_version: - print cxx_version - return 0 - - cxx_version = GetVersionFromEnvironment("CXX") - if cxx_version: - print cxx_version - return 0 - - # Otherwise we check the g++ version. - gccversion = GetVersion("g++") - if gccversion != "": - print gccversion - return 0 + # Check if CXX environment variable exists and + # if it does use that compiler. + cxx = os.getenv("CXX", None) + if cxx: + cxxversion = GetVersion(cxx) + if cxxversion != "": + print cxxversion + return 0 + else: + # Otherwise we check the g++ version. + gccversion = GetVersion("g++") + if gccversion != "": + print gccversion + return 0 return 1 |