Explicitly pass PYTHON_INCLUDE_DIR and PYTHON_LIBRARY to CMake to avoid

using macOS's default Python2 headers.
This commit is contained in:
Darius Tan 2021-05-27 22:22:18 +12:00
parent a3d8b78ff8
commit dc9b3f4441

View file

@ -1,7 +1,8 @@
import os import os
import re import re
import sys
import platform import platform
import sys
import sysconfig
import subprocess import subprocess
from setuptools import setup, Extension from setuptools import setup, Extension
@ -43,7 +44,10 @@ class CMakeBuild(build_ext):
'-DKOMPUTE_OPT_BUILD_PYTHON=1', '-DKOMPUTE_OPT_BUILD_PYTHON=1',
'-DKOMPUTE_OPT_ENABLE_SPDLOG=0', '-DKOMPUTE_OPT_ENABLE_SPDLOG=0',
'-DKOMPUTE_OPT_REPO_SUBMODULE_BUILD=1', '-DKOMPUTE_OPT_REPO_SUBMODULE_BUILD=1',
'-DPYTHON_EXECUTABLE=' + sys.executable] '-DPYTHON_EXECUTABLE=' + sys.executable,
'-DPYTHON_INCLUDE_DIR=' + sysconfig.get_path('include'),
'-DPYTHON_LIBRARY=' + sysconfig.get_path('stdlib'),
]
cfg = 'Debug' if self.debug else 'Release' cfg = 'Debug' if self.debug else 'Release'
build_args = ['--config', cfg] build_args = ['--config', cfg]