Check CC environment variable
This commit is contained in:
parent
efe7a97b1d
commit
b7459231d2
@ -12,6 +12,8 @@ cp -r @PROJECT_SOURCE_DIR@/python @PROJECT_BINARY_DIR@
|
|||||||
cd @PROJECT_BINARY_DIR@/python
|
cd @PROJECT_BINARY_DIR@/python
|
||||||
rm -f python/opm/libopmcommon_python.so
|
rm -f python/opm/libopmcommon_python.so
|
||||||
|
|
||||||
|
export CC=@CMAKE_CXX_COMPILER@
|
||||||
|
|
||||||
python setup.py build build_ext --build-lib=python/opm \
|
python setup.py build build_ext --build-lib=python/opm \
|
||||||
--library-dirs=@_setup_lib_dirs@ \
|
--library-dirs=@_setup_lib_dirs@ \
|
||||||
--include-dirs=@_setup_include_dirs@
|
--include-dirs=@_setup_include_dirs@
|
||||||
|
@ -36,15 +36,16 @@ if setupdir != '':
|
|||||||
os.chdir( setupdir )
|
os.chdir( setupdir )
|
||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.call(["c++", "--version"])
|
subprocess.call(['ccache', '--version'])
|
||||||
subprocess.call(['ccache', '--version'])
|
cc = os.environ.get("CC", "c++")
|
||||||
os.environ['CC'] = 'ccache c++'
|
os.environ['CC'] = 'ccache {}'.format(cc)
|
||||||
|
print("Using 'ccache {}' as compiler".format(cc))
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
print('\nNOTE: please install ccache for faster compilation of python bindings.\n')
|
print('\nNOTE: please install ccache for faster compilation of python bindings.\n')
|
||||||
|
|
||||||
if 'build' in sys.argv:
|
if 'build' in sys.argv:
|
||||||
if not 'build_ext' in sys.argv:
|
if not 'build_ext' in sys.argv:
|
||||||
raise TypeError("Missing option 'build_ext'.")
|
raise TypeError("Missing option 'build_ext'.")
|
||||||
|
|
||||||
ext_modules = [
|
ext_modules = [
|
||||||
Extension(
|
Extension(
|
||||||
|
Loading…
Reference in New Issue
Block a user