Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions python-package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,23 @@ class BuildExt(build_ext.build_ext):
def build(self, src_dir, build_dir, generator, build_tool=None, use_omp=1):
'''Build the core library with CMake.'''
cmake_cmd = ['cmake', src_dir, generator]

for k, v in USER_OPTIONS.items():
arg = k.replace('-', '_').upper()
value = str(v[2])
cmake_cmd.append('-D' + arg + '=' + value)
if k == 'USE_OPENMP' and use_omp == 0:
continue

if system() == 'Windows':
cmake_cmd.append('--build')

subprocess.check_call(cmake_cmd, cwd=build_dir)

if system() != 'Windows':
nproc = os.cpu_count()
subprocess.check_call([build_tool, '-j' + str(nproc)],
cwd=build_dir)
else:
subprocess.check_call(['cmake', '--build', '.',
'--config', 'Release'], cwd=build_dir)

def build_cmake_extension(self):
'''Configure and build using CMake'''
Expand Down