Skip to content

Commit

Permalink
Try to fix Windows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Jan 13, 2025
1 parent 1363fc2 commit bdbbeb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ endif (DEFINED ENV{BOOST_ROOT})

if (MSVC)
target_compile_options(_find_a_factor PUBLIC /O2 /std:c++14)
set_target_properties(_find_a_factor PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/$<0:>)
else (MSVC)
target_compile_options(_find_a_factor PUBLIC -O3 -std=c++14 -lpthread)
endif (MSVC)
Expand Down
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def build_extension(self, ext):
cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir]
self.spawn(['cmake', ext.sourcedir] + cmake_args)
self.spawn(['cmake', '--build', '.', '--config', 'Release'])
if os.name == 'nt':
os.chdir(extdir)
os.rename('Release/_find_a_factor.cp312-win_amd64.pyd', '_find_a_factor.cp312-win_amd64.pyd')
os.rmdir('Release')
os.chdir(wd)

README_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.md')
Expand Down

0 comments on commit bdbbeb2

Please sign in to comment.