diff options
author | Damien Martin-Guillerez <dmarting@google.com> | 2016-04-27 12:43:43 +0000 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2016-04-27 17:11:50 +0000 |
commit | 3bbfe16a9cd2cf502a23419deaf74a8826b597ad (patch) | |
tree | 2ff12f97c52e4fa1398978cb553ecd69cc15e184 /tools/cpp/cc_configure.bzl | |
parent | 7494c920da2927c446872ff150abe5f37b24cabf (diff) |
cc_configure.bzl: support spaces in CC environment
Also support CC to be empty and fallback to gcc.
--
MOS_MIGRATED_REVID=120907744
Diffstat (limited to 'tools/cpp/cc_configure.bzl')
-rw-r--r-- | tools/cpp/cc_configure.bzl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/cpp/cc_configure.bzl b/tools/cpp/cc_configure.bzl index 430ea73928..2c5b2a2384 100644 --- a/tools/cpp/cc_configure.bzl +++ b/tools/cpp/cc_configure.bzl @@ -267,7 +267,9 @@ def _find_cc(repository_ctx): """Find the C++ compiler.""" cc_name = "gcc" if "CC" in repository_ctx.os.environ: - cc_name = repository_ctx.os.environ["CC"] + cc_name = repository_ctx.os.environ["CC"].strip() + if not cc_name: + cc_name = "gcc" if cc_name.startswith("/"): # Absolute path, maybe we should make this suported by our which function. return cc_name |