Skip to content

Commit

Permalink
Merge pull request #265 from Mathiasdm/cmake-parallellism
Browse files Browse the repository at this point in the history
setup.py: detect parallellism instead of using hardcoded -j2
  • Loading branch information
lonvia authored Sep 10, 2024
2 parents 4855a9e + 9457ffb commit 52914ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def build_extension(self, ext):
build_args += ['--', '/m']
else:
cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg]
build_args += ['--', '-j2']
nbr_cpus = os.cpu_count() or 2 # fallback if None is returned
build_args += ['--', f'-j{nbr_cpus}']

env = os.environ.copy()
env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(env.get('CXXFLAGS', ''),
Expand Down

0 comments on commit 52914ad

Please sign in to comment.