solvespace/cython/platform/set_pycompiler.bat

26 lines
893 B
Batchfile
Raw Normal View History

2019-09-23 05:28:43 +00:00
echo off
2019-10-08 13:25:03 +00:00
REM Usage: set_pycompiler C:\Python37 mingw32
2019-09-23 05:28:43 +00:00
REM Where %PYTHON_DIR% is the directory of your Python installation.
2019-10-08 13:25:03 +00:00
REM Compiler option can be "mingw32" or "msvc".
2019-09-23 05:28:43 +00:00
REM In Pyslvs project.
set HERE=%~dp0
set PYTHON_DIR=%1
2019-10-08 13:25:03 +00:00
set COMPILER=%2
2019-09-23 05:28:43 +00:00
REM Create "distutils.cfg"
2019-10-08 14:06:04 +00:00
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%"
2019-09-23 05:28:43 +00:00
REM Apply the patch of "cygwinccompiler.py".
REM Unix "patch" command of Msys.
2021-02-12 06:21:07 +00:00
set patch="C:\Program Files\Git\usr\bin\patch.exe"
%patch% -N "%PYTHON_DIR%\lib\distutils\cygwinccompiler.py" "%HERE%\cygwinccompiler.diff"
%patch% -N "%PYTHON_DIR%\include\pyconfig.h" "%HERE%\pyconfig.diff"
2019-09-23 05:28:43 +00:00
REM Copy "vcruntime140.dll" to "libs".
copy "%PYTHON_DIR%\vcruntime140.dll" "%PYTHON_DIR%\libs"
2019-10-08 14:06:04 +00:00
echo copied "vcruntime140.dll".