Skip to content

Commit

Permalink
Skip unused CMake argument in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Jan 21, 2021
1 parent f0fd762 commit 978ea2e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python-package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@ def build(self, src_dir, build_dir, generator, build_tool=None, use_omp=1):
for k, v in USER_OPTIONS.items():
arg = k.replace('-', '_').upper()
value = str(v[2])
cmake_cmd.append('-D' + arg + '=' + value)
if k == 'USE-SYSTEM-LIBXGBOOST':
if arg == 'USE_SYSTEM_LIBXGBOOST':
continue
if k == 'USE_OPENMP' and use_omp == 0:
if arg == 'USE_OPENMP' and use_omp == 0:
cmake_cmd.append("-D" + arg + "=0")
continue
cmake_cmd.append('-D' + arg + '=' + value)

self.logger.info('Run CMake command: %s', str(cmake_cmd))
subprocess.check_call(cmake_cmd, cwd=build_dir)
Expand Down

0 comments on commit 978ea2e

Please sign in to comment.