Update Windows CMake builds to use NuGet package for PCRE2

This commit is contained in:
sethg 2022-03-31 19:08:46 +02:00
commit e60a02941f

View file

@ -248,15 +248,8 @@ For fully working build steps always check the Continuous Integration (CI) setup
and save to a folder e.g. <tt>C:\Tools\Bison</tt> and save to a folder e.g. <tt>C:\Tools\Bison</tt>
</li> </li>
<li> <li>
Unfortunately, PCRE2 is not yet available on Nuget. Instead we will use CMake to build and install <a href="https://www.pcre.org/">PCRE2</a> to <tt>C:\Tools\pcre2</tt> using the following commands: Install the <a href="https://www.nuget.org/packages/pcre2/">PCRE2 Nuget package</a> using the following command: <pre>C:\Tools\nuget install PCRE2 -Version 10.39 -OutputDirectory C:\Tools\pcre2</pre>.
<div class="shell"><pre> Note this is a x64 build, if this is not suitable PCRE2 can be built from source using <a href="https://github.com/PhilipHazel/pcre2/">https://github.com/PhilipHazel/pcre2/</a>.
cd C:\
SET PATH=C:\Tools\CMake\CMake-win64.3.15.5\bin;%PATH%
git clone https://github.com/PhilipHazel/pcre2.git
cd pcre2
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=C:/Tools/pcre2 -S . -B build
cmake --build build --config Release --target install
</pre></div>
Alternatively, set <tt>WITH_PCRE=OFF</tt> to disable PCRE2 support if you are sure you do not require it. Alternatively, set <tt>WITH_PCRE=OFF</tt> to disable PCRE2 support if you are sure you do not require it.
</li> </li>
<li> <li>
@ -271,10 +264,12 @@ cmake --build build --config Release --target install
architecture. We add the required build tools to the system PATH, and then architecture. We add the required build tools to the system PATH, and then
build a Release version of SWIG. If all runs successfully a new swig.exe should be generated in the <tt>C:/swig/install2/bin</tt> folder. build a Release version of SWIG. If all runs successfully a new swig.exe should be generated in the <tt>C:/swig/install2/bin</tt> folder.
</p> </p>
</li>
</ol>
<div class="shell"><pre> <div class="shell"><pre>
cd C:\swig cd C:\swig
SET PATH=C:\Tools\CMake\CMake-win64.3.15.5\bin;C:\Tools\bison\Bison.3.7.4\bin;%PATH% SET PATH=C:\Tools\CMake\CMake-win64.3.15.5\bin;C:\Tools\bison\Bison.3.7.4\bin;%PATH%
SET PCRE_ROOT=C:/Tools/pcre2 SET PCRE_ROOT=C:\Tools\pcre2\PCRE2.10.39.0
SET PCRE_PLATFORM=x64 SET PCRE_PLATFORM=x64
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX="%CD:\=/%/install2" -DCMAKE_C_FLAGS="/DPCRE2_STATIC" ^ cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX="%CD:\=/%/install2" -DCMAKE_C_FLAGS="/DPCRE2_STATIC" ^
-DCMAKE_CXX_FLAGS="/DPCRE2_STATIC" -DPCRE2_INCLUDE_DIR=%PCRE_ROOT%/include -DPCRE2_LIBRARY=%PCRE_ROOT%/lib/pcre2-8-static.lib -S . -B build -DCMAKE_CXX_FLAGS="/DPCRE2_STATIC" -DPCRE2_INCLUDE_DIR=%PCRE_ROOT%/include -DPCRE2_LIBRARY=%PCRE_ROOT%/lib/pcre2-8-static.lib -S . -B build
@ -284,8 +279,7 @@ REM to test the exe
cd install2/bin cd install2/bin
swig.exe -help swig.exe -help
</pre></div> </pre></div>
</li>
</ol>
<p> <p>
In addition to Release builds you can create a Debug build using: In addition to Release builds you can create a Debug build using:
</p> </p>