From 8952591dbd9529b5feb2bd458b8f8aa6b52440dd Mon Sep 17 00:00:00 2001 From: KmolYuan Date: Tue, 8 Oct 2019 22:06:04 +0800 Subject: [PATCH] Allow reusing "set_compiler" command. --- cython/platform/set_pycompiler.bat | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cython/platform/set_pycompiler.bat b/cython/platform/set_pycompiler.bat index 5d32358e..02d45e46 100644 --- a/cython/platform/set_pycompiler.bat +++ b/cython/platform/set_pycompiler.bat @@ -9,12 +9,15 @@ set PYTHON_DIR=%1 set COMPILER=%2 REM Create "distutils.cfg" -echo [build]>> "%PYTHON_DIR%\Lib\distutils\distutils.cfg" -echo compiler=%COMPILER%>> "%PYTHON_DIR%\Lib\distutils\distutils.cfg" - +set DISTUTILS=%PYTHON_DIR%\Lib\distutils\distutils.cfg +if exist "%DISTUTILS%" del "%DISTUTILS%" /Q /S +echo [build]>> "%DISTUTILS%" +echo compiler=%COMPILER%>> "%DISTUTILS%" +echo patched file "%DISTUTILS%" REM Apply the patch of "cygwinccompiler.py". REM Unix "patch" command of Msys. -patch "%PYTHON_DIR%\lib\distutils\cygwinccompiler.py" "%HERE%patch.diff" +patch -N "%PYTHON_DIR%\lib\distutils\cygwinccompiler.py" "%HERE%\patch.diff" REM Copy "vcruntime140.dll" to "libs". copy "%PYTHON_DIR%\vcruntime140.dll" "%PYTHON_DIR%\libs" +echo copied "vcruntime140.dll".