Skip to content

Commit 58393ff

Browse files
committed
Fix CMake module path and split CI configure per platform
1 parent a172390 commit 58393ff

2 files changed

Lines changed: 23 additions & 10 deletions

File tree

.github/workflows/validate-dnr-rules.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
jobs:
1313
build:
1414
strategy:
15+
fail-fast: false
1516
matrix:
1617
include:
1718
- os: macos-latest
@@ -34,17 +35,23 @@ jobs:
3435
if: runner.os == 'macOS'
3536
run: brew install cmake ninja icu4c pkg-config
3637

37-
- name: Configure
38+
- name: Configure (Linux)
39+
if: runner.os == 'Linux'
3840
run: |
3941
cmake -B build -G Ninja \
4042
-DCMAKE_BUILD_TYPE=Release \
4143
-DPORT=GTK \
42-
-DENABLE_WEBCORE=OFF \
43-
-DENABLE_WEBKIT=OFF \
44-
-DENABLE_TOOLS=OFF \
44+
ghostery/validate-dnr-rules
45+
46+
- name: Configure (macOS)
47+
if: runner.os == 'macOS'
48+
run: |
49+
cmake -B build -G Ninja \
50+
-DCMAKE_BUILD_TYPE=Release \
51+
-DPORT=Mac \
4552
ghostery/validate-dnr-rules
4653
env:
47-
CMAKE_PREFIX_PATH: ${{ runner.os == 'macOS' && '/opt/homebrew/opt/icu4c' || '' }}
54+
CMAKE_PREFIX_PATH: /opt/homebrew/opt/icu4c
4855

4956
- name: Build
5057
run: cmake --build build --target validate-dnr-rules

ghostery/validate-dnr-rules/CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
cmake_minimum_required(VERSION 3.20)
2+
3+
set(WEBKIT_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../..")
4+
5+
# Set up WebKit's CMake module path before project() so platform detection works
6+
set(CMAKE_MODULE_PATH "${WEBKIT_ROOT}/Source/cmake" ${CMAKE_MODULE_PATH})
7+
list(APPEND CMAKE_MODULE_PATH "${WEBKIT_ROOT}/Source/cmake")
8+
29
project(validate-dnr-rules CXX C)
310

411
set(CMAKE_CXX_STANDARD 23)
512
set(CMAKE_CXX_STANDARD_REQUIRED ON)
613

7-
set(WEBKIT_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../..")
8-
9-
# Use WebKit's CMake infrastructure for WTF
14+
# WebKit build system variables
1015
set(WTF_DIR "${WEBKIT_ROOT}/Source/WTF")
16+
set(WTF_SCRIPTS_DIR "${WTF_DIR}/wtf/Scripts")
1117
set(JavaScriptCore_SCRIPTS_DIR "${WEBKIT_ROOT}/Source/JavaScriptCore/Scripts")
1218

13-
# Include WebKit's top-level CMake options
14-
include("${WEBKIT_ROOT}/Source/cmake/WebKitCommon.cmake" OPTIONAL)
19+
# Include WebKit's common cmake (handles platform detection, find_package, etc.)
20+
include(WebKitCommon)
1521

1622
# Build WTF as a dependency
1723
if (NOT TARGET WTF)

0 commit comments

Comments
 (0)