Annotation of win32/pcre2/compile.cmd, revision 1.2
1.1 moko 1: @echo off
2: REM Builds PCRE2 8-bit library (static, without JIT) in 4 variants (Win32/x64 x Release/Debug) with the VS2017 (v141) toolset.
1.2 ! moko 3: REM Run it from the unpacked pcre2 source directory (see source.url), the results are copied next to this script
1.1 moko 4: REM Parser does not use JIT. Match depth limit is the same as under Unix.
5:
6: set VSDIR=C:\Program Files\Microsoft Visual Studio\18\Community
7: set VCVARSALL=%VSDIR%\VC\Auxiliary\Build\vcvarsall.bat
8: set CMAKE=%VSDIR%\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe
9:
10: call :build x86 Release MultiThreaded Release pcre2-8-static.lib
11: call :build x86 Debug MultiThreadedDebug Debug pcre2-8-staticd.lib
12: call :build amd64 Release MultiThreaded x64\Release pcre2-8-static.lib
13: call :build amd64 Debug MultiThreadedDebug x64\Debug pcre2-8-staticd.lib
14:
15: if not exist "%~dp0include" mkdir "%~dp0include"
16: copy /Y build-x86-Release\interface\pcre2.h "%~dp0include\" || exit /b 1
17: exit /b 0
18:
19: :build
20: REM %1 - vcvarsall architecture, %2 - configuration, %3 - CMAKE_MSVC_RUNTIME_LIBRARY, %4 - destination (relative to this script), %5 - name of the built library
21: setlocal
22: call "%VCVARSALL%" %1 -vcvars_ver=14.16 || exit /b 1
23: "%CMAKE%" -S . -B build-%1-%2 -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=%2 ^
24: -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DPCRE2_BUILD_PCRE2_8=ON -DPCRE2_SUPPORT_JIT=OFF -DPCRE2_SUPPORT_UNICODE=ON ^
25: -DPCRE2_MATCH_LIMIT_DEPTH=10000 -DPCRE2_DEBUG=OFF -DPCRE2_BUILD_PCRE2GREP=OFF -DPCRE2_BUILD_TESTS=OFF ^
26: -DCMAKE_MSVC_RUNTIME_LIBRARY=%3 -DCMAKE_C_FLAGS_DEBUG="/Z7 /Ob0 /Od /RTC1" || exit /b 1
27: "%CMAKE%" --build build-%1-%2 --target pcre2-8-static || exit /b 1
28: if not exist "%~dp0%4" mkdir "%~dp0%4"
29: copy /Y build-%1-%2\%5 "%~dp0%4\pcre2-8-static.lib" || exit /b 1
30: endlocal
31: exit /b 0
E-mail: