@@ -125,21 +125,31 @@ jobs:
125125 run : |
126126 INSTALL_PREFIX=`pwd`/build/install-dir
127127 cd maint/cmake-tests/install-interface
128- cmake -DCMAKE_PREFIX_PATH="$INSTALL_PREFIX" -B build
129- cd build
130- make
131- ./test_executable
128+
129+ for useStaticLibs in ON OFF; do
130+ echo "== Testing CMake install interface with PCRE2_USE_STATIC_LIBS=$useStaticLibs =="
131+ rm -rf build
132+ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$INSTALL_PREFIX" -DPCRE2_USE_STATIC_LIBS=$useStaticLibs -B build
133+ (cd build; make)
134+ ./build/test_executable
135+ done
132136
133137 - name : Test CMake build interface
134138 run : |
135139 BUILD_DIR=`pwd`
136140 cp -rp maint/cmake-tests/build-interface ../cmake-tests-build-interface
137141 cd ../cmake-tests-build-interface
138142 ln -s "$BUILD_DIR" pcre2
139- cmake -B build
140- cd build
141- make
142- ./test_executable
143+
144+ for buildLibs in "ON;OFF" "OFF;ON"; do
145+ static=$(echo $buildLibs | cut -d';' -f1)
146+ shared=$(echo $buildLibs | cut -d';' -f2)
147+ echo "== Testing CMake build interface with BUILD_STATIC_LIBS=$static and BUILD_SHARED_LIBS=$shared =="
148+ rm -rf build
149+ cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_STATIC_LIBS=$static -DBUILD_SHARED_LIBS=$shared -B build
150+ (cd build; make)
151+ ./build/test_executable
152+ done
143153
144154 windows :
145155 name : Windows
@@ -174,19 +184,29 @@ jobs:
174184 run : |
175185 $INSTALL_PREFIX = (pwd).Path + "\build\install-dir"
176186 cd maint/cmake-tests/install-interface
177- cmake -DCMAKE_PREFIX_PATH="$INSTALL_PREFIX" -B build -A ${{ matrix.arch }}
178- cmake --build build --config Release
179- ./build/Release/test_executable.exe
187+
188+ foreach ($useStaticLibs in @("ON", "OFF")) {
189+ echo "== Testing CMake install interface with PCRE2_USE_STATIC_LIBS=$useStaticLibs =="
190+ rm -Recurse -Force build
191+ cmake -DCMAKE_PREFIX_PATH="$INSTALL_PREFIX" -DPCRE2_USE_STATIC_LIBS=$useStaticLibs -B build -A ${{ matrix.arch }}
192+ cmake --build build --config Release
193+ ./build/Release/test_executable.exe
194+ }
180195
181196 - name : Test CMake build interface
182197 run : |
183198 $BUILD_DIR = (pwd).Path
184199 cp -Recurse -Path maint/cmake-tests/build-interface ../cmake-tests-build-interface
185200 cd ../cmake-tests-build-interface
186201 New-Item -ItemType SymbolicLink -Path "pcre2" -Target "$BUILD_DIR"
187- cmake -B build -A ${{ matrix.arch }}
188- cmake --build build --config Debug
189- ./build/Debug/test_executable.exe
202+
203+ foreach ($buildLibs in @(@{static="ON"; shared="OFF"}, @{static="OFF"; shared="ON"})) {
204+ echo "== Testing CMake build interface with BUILD_STATIC_LIBS=$($buildLibs.static) =="
205+ rm -Recurse -Force build
206+ cmake -DBUILD_STATIC_LIBS=$($buildLibs.static) -DBUILD_SHARED_LIBS=$($buildLibs.shared) -B build -A ${{ matrix.arch }}
207+ cmake --build build --config Debug
208+ ./build/Debug/test_executable.exe
209+ }
190210
191211 freebsd :
192212 name : FreeBSD
0 commit comments