build_task.bat 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. @echo off
  2. if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL
  3. if %errorlevel% neq 0 exit /b 3
  4. if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin64 >NUL 2>NUL
  5. if %errorlevel% neq 0 exit /b 3
  6. if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL
  7. if %errorlevel% neq 0 exit /b 3
  8. if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL
  9. if %errorlevel% neq 0 exit /b 3
  10. if "%APPVEYOR%" equ "True" rmdir /s /q C:\msys64 >NUL 2>NUL
  11. if %errorlevel% neq 0 exit /b 3
  12. if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win32 >NUL 2>NUL
  13. if %errorlevel% neq 0 exit /b 3
  14. if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win64 >NUL 2>NUL
  15. if %errorlevel% neq 0 exit /b 3
  16. if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win32 >NUL 2>NUL
  17. if %errorlevel% neq 0 exit /b 3
  18. if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win64 >NUL 2>NUL
  19. if %errorlevel% neq 0 exit /b 3
  20. if "%APPVEYOR%" equ "True" del /f /q C:\Windows\System32\libcrypto-1_1-x64.dll >NUL 2>NUL
  21. if %errorlevel% neq 0 exit /b 3
  22. if "%APPVEYOR%" equ "True" del /f /q C:\Windows\System32\libssl-1_1-x64.dll >NUL 2>NUL
  23. if %errorlevel% neq 0 exit /b 3
  24. cd /D %APPVEYOR_BUILD_FOLDER%
  25. if %errorlevel% neq 0 exit /b 3
  26. if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
  27. set BRANCH=%APPVEYOR_REPO_BRANCH:~4,3%
  28. ) else (
  29. set BRANCH=master
  30. )
  31. set STABILITY=staging
  32. set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VS%-%PHP_SDK_ARCH%
  33. rem SDK is cached, deps info is cached as well
  34. echo Updating dependencies in %DEPS_DIR%
  35. cmd /c phpsdk_deps --update --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR% --crt %PHP_BUILD_CRT%
  36. if %errorlevel% neq 0 exit /b 3
  37. rem Something went wrong, most likely when concurrent builds were to fetch deps
  38. rem updates. It might be, that some locking mechanism is needed.
  39. if not exist "%DEPS_DIR%" (
  40. cmd /c phpsdk_deps --update --force --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
  41. )
  42. if %errorlevel% neq 0 exit /b 3
  43. cmd /c buildconf.bat --force
  44. if %errorlevel% neq 0 exit /b 3
  45. if "%THREAD_SAFE%" equ "0" set ADD_CONF=%ADD_CONF% --disable-zts
  46. if "%INTRINSICS%" neq "" set ADD_CONF=%ADD_CONF% --enable-native-intrinsics=%INTRINSICS%
  47. set CFLAGS=/W1 /WX
  48. cmd /c configure.bat ^
  49. --enable-snapshot-build ^
  50. --disable-debug-pack ^
  51. --enable-com-dotnet=shared ^
  52. --without-analyzer ^
  53. --enable-object-out-dir=%PHP_BUILD_OBJ_DIR% ^
  54. --with-php-build=%DEPS_DIR% ^
  55. %ADD_CONF% ^
  56. --disable-test-ini
  57. if %errorlevel% neq 0 exit /b 3
  58. nmake /NOLOGO
  59. if %errorlevel% neq 0 exit /b 3
  60. exit /b 0