Skip to content

Commit 1059f2b

Browse files
committed
fixed building outdated (pre-3.5) CMake projects in CI / some cleanups
1 parent 31a5db8 commit 1059f2b

5 files changed

Lines changed: 32 additions & 10 deletions

File tree

.github/workflows/CI-windows.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,22 @@ jobs:
122122
- name: Download PCRE
123123
if: steps.cache-pcre.outputs.cache-hit != 'true'
124124
run: |
125-
curl -fsSL https://github.com/pfultz2/pcre/archive/refs/tags/%PCRE_VERSION%.zip -o pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
125+
curl -fsSL https://github.com/pfultz2/pcre/archive/refs/tags/%PCRE_VERSION%.zip -o pcre.zip || exit /b !errorlevel!
126126
127127
- name: Install PCRE
128128
if: steps.cache-pcre.outputs.cache-hit != 'true'
129129
run: |
130-
7z x pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
131-
cd pcre-%PCRE_VERSION% || exit /b !errorlevel!
132-
cmake . -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DPCRE_BUILD_PCRECPP=Off -DPCRE_BUILD_TESTS=Off -DPCRE_BUILD_PCREGREP=Off || exit /b !errorlevel!
130+
7z x pcre.zip || exit /b !errorlevel!
131+
del pcre.zip || exit /b !errorlevel!
132+
rename pcre-%PCRE_VERSION% pcre || exit /b !errorlevel!
133+
cd pcre || exit /b !errorlevel!
134+
git apply --ignore-space-change ..\externals\pcre.patch || exit /b !errorlevel!
135+
cmake . -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DPCRE_BUILD_PCRECPP=Off -DPCRE_BUILD_TESTS=Off -DPCRE_BUILD_PCREGREP=Off -Wno-dev -DCMAKE_POLICY_VERSION_MINIMUM=3.5 || exit /b !errorlevel!
133136
nmake || exit /b !errorlevel!
134137
copy pcre.h ..\externals || exit /b !errorlevel!
135138
copy pcre.lib ..\externals\pcre64.lib || exit /b !errorlevel!
139+
cd .. || exit /b !errorlevel!
140+
rd /s /q pcre || exit /b !errorlevel!
136141
env:
137142
CL: /MP
138143

.github/workflows/format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
run: |
3939
wget https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.72.0.tar.gz
4040
tar xzvf uncrustify-0.72.0.tar.gz && cd uncrustify-uncrustify-0.72.0
41-
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
41+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM=3.5
4242
cmake --build build -- -j$(nproc) -s
4343
mkdir ~/uncrustify
4444
cd build && cp uncrustify ~/uncrustify/

.github/workflows/release-windows.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,22 @@ jobs:
4949
- name: Download PCRE
5050
if: steps.cache-pcre.outputs.cache-hit != 'true'
5151
run: |
52-
curl -fsSL https://github.com/pfultz2/pcre/archive/refs/tags/%PCRE_VERSION%.zip -o pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
52+
curl -fsSL https://github.com/pfultz2/pcre/archive/refs/tags/%PCRE_VERSION%.zip -o pcre.zip || exit /b !errorlevel!
5353
5454
- name: Install PCRE
5555
if: steps.cache-pcre.outputs.cache-hit != 'true'
5656
run: |
57-
7z x pcre-%PCRE_VERSION%.zip || exit /b !errorlevel!
58-
cd pcre-%PCRE_VERSION% || exit /b !errorlevel!
59-
cmake . -G "Visual Studio 17 2022" -A x64 -DPCRE_BUILD_PCRECPP=OFF -DPCRE_BUILD_PCREGREP=OFF -DPCRE_BUILD_TESTS=OFF || exit /b !errorlevel!
57+
7z x pcre.zip || exit /b !errorlevel!
58+
del pcre.zip || exit /b !errorlevel!
59+
rename pcre-%PCRE_VERSION% pcre || exit /b !errorlevel!
60+
cd pcre || exit /b !errorlevel!
61+
git apply --ignore-space-change ..\externals\pcre.patch || exit /b !errorlevel!
62+
cmake . -G "Visual Studio 17 2022" -A x64 -DPCRE_BUILD_PCRECPP=OFF -DPCRE_BUILD_PCREGREP=OFF -DPCRE_BUILD_TESTS=OFF -Wno-dev -DCMAKE_POLICY_VERSION_MINIMUM=3.5 || exit /b !errorlevel!
6063
msbuild -m PCRE.sln -p:Configuration=Release -p:Platform=x64 || exit /b !errorlevel!
6164
copy pcre.h ..\externals || exit /b !errorlevel!
6265
copy Release\pcre.lib ..\externals\pcre64.lib || exit /b !errorlevel!
66+
cd .. || exit /b !errorlevel!
67+
rd /s /q pcre || exit /b !errorlevel!
6368
6469
# available modules: https://github.com/miurahr/aqtinstall/blob/master/docs/getting_started.rst#installing-modules
6570
# available tools: https://github.com/miurahr/aqtinstall/blob/master/docs/getting_started.rst#installing-tools

.github/workflows/selfcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ jobs:
160160
161161
- name: CMake (corpus / no test)
162162
run: |
163-
cmake -S cppcheck-2.8 -B cmake.output.corpus -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=Off -DBUILD_GUI=ON -DUSE_QT6=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On
163+
cmake -S cppcheck-2.8 -B cmake.output.corpus -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=Off -DBUILD_GUI=ON -DUSE_QT6=On -DWITH_QCHART=ON -DENABLE_CHECK_INTERNAL=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DCMAKE_POLICY_VERSION_MINIMUM=3.5
164164
165165
- name: Generate dependencies (corpus)
166166
run: |

externals/pcre.patch

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff -urN pcre/CMakeLists.txt pcre-8.45/CMakeLists.txt
2+
--- pcre/CMakeLists.txt 2021-11-05 13:28:16.000000000 +0100
3+
+++ pcre-8.45/CMakeLists.txt 2025-04-02 10:18:49.636009900 +0200
4+
@@ -77,7 +77,7 @@
5+
# CMP0026 to avoid warnings for the use of LOCATION in GET_TARGET_PROPERTY.
6+
7+
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5)
8+
-CMAKE_POLICY(SET CMP0026 OLD)
9+
+#CMAKE_POLICY(SET CMP0026 OLD)
10+
11+
# For FindReadline.cmake. This was changed to allow setting CMAKE_MODULE_PATH
12+
# on the command line.

0 commit comments

Comments
 (0)