diff --git a/buildconfig/config_msys2.py b/buildconfig/config_msys2.py index 1fab5b90..ba594be8 100644 --- a/buildconfig/config_msys2.py +++ b/buildconfig/config_msys2.py @@ -472,7 +472,7 @@ def main(auto_config=False): if download_prebuilt: download_prebuilt = os.environ['PYGAME_DOWNLOAD_PREBUILT'] == '1' else: - download_prebuilt = True + download_prebuilt = False try: from . import download_msys2_prebuilt @@ -485,7 +485,7 @@ def main(auto_config=False): } download_kwargs[machine_type] = True if download_prebuilt: - download_msys2_prebuilt.update(**download_kwargs) + pass # MSYS2 config only supports setup with prebuilt dependencies # The prebuilt dir is the MinGW root from the MSYS2 @@ -497,7 +497,7 @@ def main(auto_config=False): 'x86': '/mingw32', 'x64': '/mingw64' } - prebuilt_dir = get_absolute_win_path(prebuilt_msys_dir[machine_type]) + prebuilt_dir = get_absolute_win_path(os.environ['MINGW_PREFIX']) return setup_prebuilt_sdl2(prebuilt_dir) diff --git a/setup.py b/setup.py index 888d7a45..1c2801b6 100644 --- a/setup.py +++ b/setup.py @@ -434,8 +434,8 @@ for e in extensions: e.extra_compile_args.extend( # some warnings are skipped here ("/W3", "/wd4142", "/wd4996") - if sys.platform == "win32" - else ("-Wall", "-Wno-error=unknown-pragmas") + if (sys.platform == "win32" and "MSC" in sys.version) + else ("-Wall", "-Wno-unknown-pragmas") ) if "surface" in e.name and sys.platform == "darwin": @@ -447,7 +447,7 @@ for e in extensions: if sysconfig.get_config_var("MAINCC") != "clang": e.extra_compile_args.append("-Wno-error=unused-but-set-variable") - if "mask" in e.name and sys.platform == "win32": + if "mask" in e.name and sys.platform == "win32" and "MSC" in sys.version: # skip analyze warnings that pop up a lot in mask for now. TODO fix e.extra_compile_args.extend(("/wd6385", "/wd6386")) @@ -457,7 +457,7 @@ for e in extensions: and e.name not in ("pypm", "_sprite", "gfxdraw") ): # Do -Werror only on CI, and exclude -Werror on Cython C files and gfxdraw - e.extra_compile_args.append("/WX" if sys.platform == "win32" else "-Werror") + e.extra_compile_args.append("/WX" if (sys.platform == "win32" and "MSC" in sys.version) else "-Wundef") # if not building font, try replacing with ftfont alternate_font = os.path.join('src_py', 'font.py') @@ -729,7 +729,7 @@ if sys.platform == 'win32' and not 'WIN32_DO_NOT_INCLUDE_DEPS' in os.environ: # Only on win32, not MSYS2 - if 'MSYSTEM' not in os.environ: + if "MSC" in sys.version: @add_command('build_ext') class WinBuildExt(build_ext): """This build_ext sets necessary environment variables for MinGW"""