From 965d1a1b8fe4080ee7e7fd55dedd98e0a6450174 Mon Sep 17 00:00:00 2001 From: Subhasis Ray Date: Wed, 12 Jun 2024 16:16:00 +0530 Subject: [PATCH] Attempt to fix build - setup.py: use `cmake --build` for all systems - switch filename suffix pyd back to dll for windows --- pybind11/CMakeLists.txt | 2 +- setup.py | 20 +++++++------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/pybind11/CMakeLists.txt b/pybind11/CMakeLists.txt index 1f99586f65..c373f29dbf 100644 --- a/pybind11/CMakeLists.txt +++ b/pybind11/CMakeLists.txt @@ -21,7 +21,7 @@ if(WIN32) set_target_properties(moose PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/python/moose PREFIX "_" - SUFFIX ".pyd") + SUFFIX ".dll") else() set_target_properties(moose PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/python/moose diff --git a/setup.py b/setup.py index 28f854f022..1adf01304b 100644 --- a/setup.py +++ b/setup.py @@ -114,12 +114,9 @@ def finalize_options(self): else: if self.with_gsl_static: self.cmake_options['GSL_USE_STATIC_LIBRARIES'] = 'ON' - if self.debug is not None: - self.cmake_options['CMAKE_BUILD_TYPE'] = 'Debug' - else: + if self.debug is None: self.debug = 0 - self.cmake_options['CMAKE_BUILD_TYPE'] = 'Release' - + def run(self): if self.no_build: return @@ -137,14 +134,10 @@ def build_cmake(self, ext): for k, v in self.cmake_options.items(): cmake_args.append(f'-D{k}={v}') os.chdir(str(builddir_)) - self.spawn(['cmake', str(sdir_)] + cmake_args) - if not self.dry_run and platform.system() != 'Windows': - self.spawn(['make', f'-j{numCores_:d}']) - else: - cmd = ['cmake', '--build', '.'] - if not self.debug: - cmd += ['--config', self.cmake_options['CMAKE_BUILD_TYPE']] - self.spawn(cmd) + # cmd = ['cmake', '--build', '.', f'-j{numCores_:d}'] + cmake_args + cmd = ['cmake', '--build', str(sdir_), f'-j{numCores_:d}'] + cmake_args + cmd += ['--config', 'Debug' if self.debug else 'Release'] + self.spawn(cmd) os.chdir(str(sdir_)) @@ -176,6 +169,7 @@ def build_cmake(self, ext): 'rdesigneur': os.path.join(sdir_, 'python', 'rdesigneur'), 'moose': os.path.join(sdir_, 'python', 'moose'), }, + package_data={ 'moose': [ '_moose.so',