Skip unused CMake argument in setup.py (#6611)

This commit is contained in:
Jiaming Yuan 2021-01-21 17:25:33 +08:00 committed by GitHub
parent f0fd7629ae
commit 26982f9fce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,11 +105,12 @@ class BuildExt(build_ext.build_ext): # pylint: disable=too-many-ancestors
for k, v in USER_OPTIONS.items():
arg = k.replace('-', '_').upper()
value = str(v[2])
if arg == 'USE_SYSTEM_LIBXGBOOST':
continue
if arg == 'USE_OPENMP' and use_omp == 0:
cmake_cmd.append("-D" + arg + "=0")
continue
cmake_cmd.append('-D' + arg + '=' + value)
if k == 'USE-SYSTEM-LIBXGBOOST':
continue
if k == 'USE_OPENMP' and use_omp == 0:
continue
self.logger.info('Run CMake command: %s', str(cmake_cmd))
subprocess.check_call(cmake_cmd, cwd=build_dir)