Tell Cmake to use clang-cl when requested

This commit is contained in:
Andrew Cassidy 2022-05-16 23:13:40 -07:00
parent b2523dbe19
commit 4b3e236275

View File

@ -46,7 +46,6 @@ class CMakeBuild(build_ext):
"-DPython_EXECUTABLE={}".format(sys.executable),
"-DPython_ROOT_DIR={}".format(os.path.dirname(sys.executable)),
"-DQUICKTEX_VERSION_INFO={}".format(version), # include version info in module
"-DQUICKTEX_MODULE_ONLY=TRUE", # only build the module, not the wrapper
"-DCMAKE_BUILD_TYPE={}".format(cfg), # not used on MSVC, but no harm
# clear cached make program binary, see https://github.com/pypa/setuptools/issues/2912
"-U",
@ -67,6 +66,9 @@ class CMakeBuild(build_ext):
cmake_args += ["-GNinja"]
else:
if 'CC' in os.environ and 'clang-cl' in os.environ['CC']:
cmake_args += ['ClangCL'] # https://stackoverflow.com/a/64189112/7645957
# Single config generators are handled "normally"
single_config = any(x in cmake_generator for x in {"NMake", "Ninja"})