Skip to content

Commit bf7c8ce

Browse files
committed
Use clang in g++ driver mode if no clang++ is available.
1 parent 1fa23dd commit bf7c8ce

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

graalpython/lib-python/3/distutils/sysconfig_graalpython.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,15 @@ def _init_posix():
6969
so_ext = ".so" if not darwin_native else ".dylib"
7070
assert _imp.extension_suffixes()[0] == "." + so_abi + so_ext, "mismatch between extension suffix to _imp.extension_suffixes"
7171

72+
toolchain_cxx = sys.__graal_get_toolchain_path('CXX')
73+
have_cxx = toolchain_cxx is not None
7274

7375
g = {}
7476
g['CC'] = sys.__graal_get_toolchain_path('CC')
75-
g['CXX'] = sys.__graal_get_toolchain_path('CXX')
77+
g['CXX'] = toolchain_cxx if have_cxx else g['CC'] + ' --driver-mode=g++ -stdlib=libc++'
7678
g['OPT'] = "-DNDEBUG -O1"
7779
g['CONFINCLUDEPY'] = get_python_inc()
78-
g['CPPFLAGS'] = '-I. -I%s' % get_python_inc()
80+
g['CPPFLAGS'] = '-I. -I' + get_python_inc()
7981
g['CFLAGS'] = "-DNDEBUG -O1"
8082
g['CCSHARED'] = "-fPIC"
8183
g['LDSHARED_LINUX'] = "%s -shared -fPIC" % sys.__graal_get_toolchain_path('CC')

0 commit comments

Comments
 (0)