diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-17 22:46:18 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-17 22:46:18 +0000 |
commit | 74a8179293acb8b49c6bda5f4ad8ae419c8003b6 (patch) | |
tree | 1c852e89262407f23a88a5511ee661d1386902c1 /tools/compile_test/compile_test.py | |
parent | a6ec2dff9104e2fe11ec5116403bfaab42959ea8 (diff) | |
download | chromium_src-74a8179293acb8b49c6bda5f4ad8ae419c8003b6.zip chromium_src-74a8179293acb8b49c6bda5f4ad8ae419c8003b6.tar.gz chromium_src-74a8179293acb8b49c6bda5f4ad8ae419c8003b6.tar.bz2 |
Fix compile_test.py for CXX values that contain spaces.
One example is CXX="ccache g++".
Using shell=True seems to be a worse option - we'd have to
construct a string to pass to bash -c, instead of building
a nice argv array.
BUG=none
R=mark@chromium.org
Review URL: https://codereview.chromium.org/14813020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200910 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/compile_test/compile_test.py')
-rwxr-xr-x | tools/compile_test/compile_test.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/compile_test/compile_test.py b/tools/compile_test/compile_test.py index 79371a1f..bbda4abf 100755 --- a/tools/compile_test/compile_test.py +++ b/tools/compile_test/compile_test.py @@ -30,7 +30,9 @@ def DoMain(argv): if not options.code: parser.error('Missing required --code switch.') - cxx = os.environ.get('CXX', 'g++') + # The environment variable might expand to a string with spaces, + # e.g. "ccache g++". Convert it to a list suitable for argv. + cxx = os.environ.get('CXX', 'g++').split() tmpdir = tempfile.mkdtemp() try: @@ -40,7 +42,7 @@ def DoMain(argv): o_path = os.path.join(tmpdir, 'test.o') - cxx_cmdline = [cxx, cxx_path, '-o', o_path] + cxx_cmdline = cxx + [cxx_path, '-o', o_path] if not options.run_linker: cxx_cmdline.append('-c') # Pass remaining arguments to the compiler. |