Merge pull request #2954 from blattms/python-use-correct-cxx-to-link

[python] Use correct C++ compiler for linking.
This commit is contained in:
Markus Blatt
2022-02-04 15:59:21 +01:00
committed by GitHub

View File

@@ -9,6 +9,7 @@ import glob
import os
import re
import subprocess
try:
from importlib.machinery import EXTENSION_SUFFIXES
suffix = EXTENSION_SUFFIXES[0]
@@ -20,6 +21,11 @@ if setupdir != '':
os.chdir( setupdir )
cc = "@CMAKE_CXX_COMPILER@"
# setuptools will use the first path as the linker.
# This should not be ccache as this will fail.
# CXX is used for linking and CC for compilation
os.environ['CXX'] = cc
try:
subprocess.call(['ccache', '--version'])
os.environ['CC'] = 'ccache {}'.format(cc)