@@ -25,14 +25,43 @@ jobs:
25
25
runs-on : ${{ matrix.os }}
26
26
27
27
steps :
28
- - name : Clone Git repository
29
- uses : actions/checkout@v4
28
+ - name : Install pkgconf
29
+ if : startsWith(matrix.os, 'ubuntu')
30
+ uses : awalsh128/cache-apt-pkgs-action@latest
31
+ with :
32
+ packages : pkgconf
33
+
34
+ - name : Setup Meson + Ninja
35
+ if : startsWith(matrix.os, 'windows')
36
+ run : |
37
+ python3 -m pip install --upgrade pip setuptools wheel
38
+ python3 -m pip install meson ninja
39
+
40
+ - name : Setup MSVC for test
41
+ if : startsWith(matrix.os, 'windows')
42
+ uses : ilammy/msvc-dev-cmd@v1
43
+ with :
44
+ arch : x86_64
30
45
31
46
- name : Install Rust
32
47
uses : dtolnay/rust-toolchain@stable
33
48
with :
34
49
toolchain : stable${{ matrix.toolchain-suffix }}
35
50
51
+ # https://github.com/pkgconf/pkgconf/issues/364
52
+ - name : Install pkgconf
53
+ if : startsWith(matrix.os, 'windows')
54
+ shell : bash
55
+ run : |
56
+ git clone https://github.com/amyspark/pkgconf --branch msvc
57
+ cd pkgconf
58
+ meson setup build --prefix=$CARGO_HOME
59
+ meson compile -C build
60
+ meson install -C build
61
+
62
+ - name : Clone Git repository
63
+ uses : actions/checkout@v4
64
+
36
65
- name : Install cargo-c applet
37
66
run : |
38
67
cargo install --path .
62
91
working-directory : example-project
63
92
run : |
64
93
sudo cp -r temp/usr/local/* /usr/local/
94
+
95
+ - name : Install into Cargo root
96
+ if : startsWith(matrix.os, 'windows')
97
+ shell : bash
98
+ working-directory : example-project
99
+ run : |
100
+ cargo cinstall --verbose --release --prefix=$CARGO_HOME
65
101
66
102
- name : Test pkg-config
67
103
if : startsWith(matrix.os, 'macos')
@@ -70,12 +106,6 @@ jobs:
70
106
test "$(pkg-config --cflags example_project)" = "-I/usr/local/include/example-project-0.1"
71
107
test "$(pkg-config --libs example_project)" = "-L/usr/local/lib -lexample-project"
72
108
73
- - name : Install pkgconf
74
- if : startsWith(matrix.os, 'ubuntu')
75
- uses : awalsh128/cache-apt-pkgs-action@latest
76
- with :
77
- packages : pkgconf
78
-
79
109
- name : Test pkgconf
80
110
if : startsWith(matrix.os, 'ubuntu')
81
111
run : |
@@ -90,6 +120,18 @@ jobs:
90
120
test "${CFLAGS%% }" = "-I/usr/local/include/example-project-0.1"
91
121
test "${LIBS%% }" = "-L/usr/local/lib/${ARCHDIR} -lexample-project"
92
122
123
+ - name : Test pkgconf
124
+ if : startsWith(matrix.os, 'windows')
125
+ shell : bash
126
+ run : |
127
+ set -x
128
+ pkgconf --version
129
+ CFLAGS=$(pkgconf --cflags example_project)
130
+ LIBS=$(pkgconf --libs example_project)
131
+
132
+ test "${CFLAGS%% }" = "-I$CARGO_HOME/bin/../include/example-project-0.1"
133
+ test "${LIBS%% }" = "-L$CARGO_HOME/bin/../lib -lexample-project"
134
+
93
135
- name : Update dynamic linker cache
94
136
if : startsWith(matrix.os, 'ubuntu')
95
137
run : |
@@ -101,3 +143,11 @@ jobs:
101
143
run : |
102
144
make
103
145
146
+ - name : Test usage from C (Meson)
147
+ if : startsWith(matrix.os, 'windows')
148
+ working-directory : example-project/usage-from-c
149
+ shell : pwsh
150
+ run :
151
+ meson setup build
152
+ meson compile -C build
153
+ meson test -C build
0 commit comments