MINGW-packages/mingw-w64-python-pybase64/001-fix-build-on-mingw.patch
2024-01-06 10:45:11 +01:00

34 lines
1.1 KiB
Diff

--- a/setup.py
+++ b/setup.py
@@ -18,7 +18,7 @@
HERE = Path(__file__).resolve().parent
OPTIONAL_EXTENSION = os.environ.get("CIBUILDWHEEL", "0") != "1"
IS_64BIT = sys.maxsize > 2**32
-IS_WINDOWS = sys.platform.startswith("win32")
+IS_MSVC = 'MSC' in sys.version
IS_MACOS = sys.platform.startswith("darwin")
log = logging.getLogger("pybase64-setup")
@@ -82,10 +82,10 @@
platform = plat_name or platform
- if not IS_WINDOWS:
+ if not IS_MSVC:
extra_config.append(f"-DCMAKE_BUILD_TYPE={build_type}")
- if IS_WINDOWS:
+ if IS_MSVC:
if not platform.startswith("win"):
raise ValueError(f"Building {platform} is not supported on Windows")
# setup cross-compile
@@ -157,7 +157,7 @@
config_options.extend(get_cmake_extra_config(plat_name, build_type))
cmake(*config_options)
cmake("--build", str(build_dir), "--config", build_type, "--verbose")
- if IS_WINDOWS:
+ if IS_MSVC:
shutil.copyfile(
build_dir / build_type / "base64.lib", build_dir / "base64.lib"
)