-
Notifications
You must be signed in to change notification settings - Fork 1.3k
update PCRE2 find module to be compatible with upstream CMake config script #3191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
a2b7ca9
78129c7
c71fb43
e5ea3c4
48947ea
e3da351
9326ca4
7af1a02
e8d7dbe
090cf08
57e14da
e2218d1
f6a3a9e
94d3d4f
11dd55a
b1f0e99
53c712e
6340933
782e579
e265b97
72a4b9c
4555e0b
42df219
c2353b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| # linux-cmake.yml | ||
| # | ||
| # GitHub Actions workflow for SWIG CMake build on Linux. | ||
| # | ||
|
|
||
| name: linux-cmake | ||
|
|
||
| # same triggers as the other workflows | ||
| on: | ||
| push: | ||
| paths-ignore: | ||
| - 'CHANGES*' | ||
| - 'Doc/**' | ||
| - 'appveyor.yml' | ||
| pull_request: | ||
| branches: master | ||
| paths-ignore: | ||
| - 'CHANGES*' | ||
| - 'Doc/**' | ||
| - 'appveyor.yml' | ||
|
|
||
| # same permissions as other worflows | ||
| permissions: | ||
| contents: read | ||
|
|
||
| # only defines one job, the "cmake" job | ||
| jobs: | ||
| cmake: | ||
| runs-on: ${{ matrix.os }} | ||
| name: CMake ${{ matrix.os }} | ||
|
|
||
| strategy: | ||
| matrix: | ||
| # note: -arm variants exist for arm64 testing | ||
| os: [ubuntu-22.04, ubuntu-24.04] | ||
| # note: can add Ninja too for ubuntu runners. 'Ninja Multi-Config' can | ||
| # be used for multi-config testing, but requires some changes to how | ||
| # CMake/CTest are being invoked in the below steps | ||
|
|
||
| env: | ||
| # install prefix for SWIG CI build | ||
| SWIG_INSTALL_PREFIX: '${{ github.workspace }}/install' | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| # if fetch-depth is 0 or >1 progress output will clutter the log | ||
| show-progress: false | ||
|
|
||
| # note: same steps as in linux.yml | ||
| - name: Machine Info | ||
| run: | | ||
| echo "nproc..." | ||
| nproc --all | ||
| echo "uname..." | ||
| uname --all | ||
| echo "meminfo..." | ||
| cat /proc/meminfo | ||
| echo "lsb-release..." | ||
| cat /etc/lsb-release | ||
|
|
||
| # note: bison is pre-installed via APT already for Ubuntu runners | ||
| - name: Install Dependencies | ||
| run: | | ||
| sudo apt install libpcre2-dev | ||
|
|
||
| # single-config build configuration (uses default single-config generator) | ||
| # note: no need to use PCRE2_ROOT as PCRE2 is installed via APT | ||
| - name: Configure | ||
| run: | | ||
| cmake --version | ||
| cmake -S . -B build \ | ||
| -DCMAKE_INSTALL_PREFIX=${{ env.SWIG_INSTALL_PREFIX }} \ | ||
| -DCMAKE_BUILD_TYPE=Release | ||
|
|
||
| - name: Build | ||
| run: cmake --build build -j | ||
|
|
||
| # note: can use -j$(nproc) for parallel testing | ||
| - name: Test | ||
| run: ctest --test-dir build -V --output-on-failure | ||
|
|
||
| - name: Install | ||
| run: | | ||
| cmake --install build | ||
| ${{ env.SWIG_INSTALL_PREFIX }}/bin/swig -version | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,8 @@ jobs: | |
| os: 'windows-2025' | ||
|
|
||
| env: | ||
| BUILD_SYS: Visual Studio ${{ matrix.VER }} | ||
| # CMake generator used | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Testing Ninja under Windows would be useful too (although I'm less sure of it working out of the box there). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll try this briefly when I have some time. The Windows runner images seem like they each only have a single Visual Studio installation, so maybe Ninja Multi-Config can pick this up. Also by using Ninja Multi-Config, I think we won't even need to modify the CMake commands. |
||
| CMAKE_GENERATOR: Visual Studio ${{ matrix.VER }} | ||
|
|
||
| steps: | ||
| - name: Machine Info | ||
|
|
@@ -40,13 +41,17 @@ jobs: | |
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| # if fetch-depth is 0 or >1 progress output will clutter the log | ||
| show-progress: false | ||
|
|
||
| - name: Install CCache | ||
| uses: hendrikmuhs/ccache-action@v1 | ||
| with: | ||
| key: ${{ matrix.os }} | ||
|
|
||
| # note: NuGet packages a static version of PCRE2 that assumes a | ||
| # statically-linked non-debug C runtime library (e.g. compiling with /MT). | ||
| # see https://learn.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=msvc-170 | ||
| - name: Install NuGet Packages | ||
| shell: powershell | ||
| run: | | ||
|
|
@@ -65,15 +70,18 @@ jobs: | |
|
|
||
| - name: Configure | ||
| shell: powershell | ||
| # note: use CMAKE_MSVC_RUNTIME_LIBRARY to use static C runtimes. this is | ||
| # specifically due to the static non-debug C runtime used by NuGet PCRE2. | ||
| # if using /NODEFAULTLIB, you need /NODEFAULTLIB:MSVCRT when building the | ||
| # release configs and /NODEFAULTLIB:MSVCRTD for the debug config | ||
| run: | | ||
| cmake --version | ||
| cmake -G "$env:BUILD_SYS" -A x64 ` | ||
| cmake -G "$env:CMAKE_GENERATOR" -A x64 ` | ||
| -DCMAKE_INSTALL_PREFIX="C:\Tools\swig" ` | ||
| -DCMAKE_C_FLAGS="/W3 /EHsc /DPCRE2_STATIC" ` | ||
| -DCMAKE_CXX_FLAGS="/W3 /EHsc /DPCRE2_STATIC" ` | ||
| -DPCRE2_INCLUDE_DIR="$env:PCRE2_PATH\include" ` | ||
| -DPCRE2_LIBRARY="$env:PCRE2_PATH\lib\pcre2-8-static.lib" ` | ||
| -DLINK_FLAGS="/NODEFAULTLIB:MSVCRT" -S . -B . | ||
| -DCMAKE_C_FLAGS="/W3 /EHsc" ` | ||
| -DCMAKE_CXX_FLAGS="/W3 /EHsc" ` | ||
| -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>" ` | ||
| -DPCRE2_ROOT="$env:PCRE2_PATH" -S . -B . | ||
|
|
||
| - name: Build | ||
| shell: powershell | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if I fully expect it to work, I think it would still be worth testing with Ninja. Personally I always use it rather than the default make generator under Unix and I think I'm not alone.
Maybe have a "matrix" with Ubuntu 22.04/Make and Ubuntu 24.04/Ninja builds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I actually had the CMake generator be part of the
matrix, but I got some feedback that the "Unix Makefiles" generator name was a bit confusing. If there's interest I can support this, e.g. with