提交 cc703505 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Try to use the full compiler path instead of a relative one.

上级 604d4d2b
......@@ -132,29 +132,38 @@ AddConfigVar('mode',
'FAST_COMPILE', 'PROFILE_MODE', 'DEBUG_MODE'),
in_c_key=False)
param = StrParam("g++")
param = "g++"
# Test whether or not g++ is present: disable C code if it is not.
try:
rc = call_subprocess_Popen(['g++', '-v'])
except OSError:
param = StrParam("")
param = ""
rc = 1
# On Mac we test for 'clang++' and use it by default
if sys.platform == 'darwin':
try:
rc = call_subprocess_Popen(['clang++', '-v'])
param = StrParam("clang++")
param = "clang++"
except OSError:
pass
# Try to find the full compiler path from the name
if param != "":
import distutils.spawn
newp = distutils.spawn.find_executable(param)
if newp is not None:
param = newp
del newp
del distutils
AddConfigVar('cxx',
"The C++ compiler to use. Currently only g++ is"
" supported, but supporting additional compilers should not be "
"too difficult. "
"If it is empty, no C++ code is compiled.",
param,
StrParam(param),
in_c_key=False)
del param
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论