Skip to content

Commit d9bf163

Browse files
committed
CI: add testing with GTK build for Windows (msvc)
Closes: #265
1 parent e6f469f commit d9bf163

4 files changed

Lines changed: 64 additions & 9 deletions

File tree

.github/workflows/msvc-env.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,45 @@ on:
99
jobs:
1010
build:
1111
runs-on: windows-latest
12+
name: Build with introspection=${{ matrix.build_introspection }}
1213
env:
1314
PYTHONIOENCODING: "utf-8"
15+
GIR_BUILD: ""
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
build_introspection: [ true, false ]
1420
steps:
1521
- uses: actions/checkout@master
1622
- uses: actions/setup-python@v1
23+
with:
24+
python-version: '3.12'
1725
- uses: seanmiddleditch/gha-setup-vsdevenv@master
26+
- name: Install GTK
27+
if: matrix.build_introspection
28+
run: |
29+
$WebClient = New-Object System.Net.WebClient
30+
$WebClient.DownloadFile("https://github.com/wingtk/gvsbuild/releases/download/2024.8.1/GTK4_Gvsbuild_2024.8.1_x64.zip","C:\GTK.zip")
31+
7z x C:\GTK.zip -oC:\GTK
32+
echo "C:\GTK\lib" | Out-File -FilePath $env:GITHUB_PATH -Append
33+
echo "C:\GTK\bin" | Out-File -FilePath $env:GITHUB_PATH -Append
34+
echo "C:\GTK" | Out-File -FilePath $env:GITHUB_PATH -Append
35+
echo "GIR_BUILD=-Dintrospection=enabled" >> $GITHUB_ENV
36+
python -m pip install setuptools
37+
python -m pip install C:\GTK\python\pycairo-1.26.1-cp312-cp312-win_amd64.whl C:\GTK\python\pygobject-3.48.2-cp312-cp312-win_amd64.whl
38+
- name: Prebuild
39+
run: |
40+
echo %PATH%
41+
where python
42+
where meson
43+
python -V
44+
python -m pip install meson==1.0.0
45+
python C:/GTK/bin/g-ir-scanner --help
46+
meson setup _build
1847
- uses: BSFishy/meson-build@v1.0.3
1948
with:
2049
action: test
2150
directory: _build
51+
setup-options: ${{ env.GIR_BUILD }}
2252
options: "--verbose"
2353
meson-version: "1.0.0"

meson.build

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ endif
227227
# then we don't build introspection data either.
228228
#
229229
# We only build introspection if we can run binaries on the host.
230+
message('find_program g-ir-scanner')
230231
gir = find_program('g-ir-scanner', required: get_option('introspection'))
231232
build_gir = get_option('introspection').allowed() and build_gobject and gir.found() and meson.can_run_host_binaries()
232233

@@ -277,6 +278,7 @@ graphene_conf = configuration_data()
277278
graphene_simd = []
278279

279280
# SSE intrinsics
281+
message('get_option sse2')
280282
sse2_cflags = []
281283
if get_option('sse2')
282284
sse_prog = '''
@@ -314,6 +316,7 @@ int main () {
314316
endif
315317

316318
# GCC/Clang vector intrinsics
319+
message('get_option gcc_vector')
317320
if get_option('gcc_vector')
318321
vector_intrin_prog = '''
319322
#if defined(__GNUC__) // Clang advertises __GNUC__ too
@@ -349,6 +352,7 @@ int main () {
349352
endif
350353

351354
# ARM NEON intrinsics
355+
message('get_option arm_neon')
352356
neon_cflags = []
353357
if get_option('arm_neon')
354358
neon_prog = '''
@@ -427,23 +431,26 @@ if graphene_build_static_only
427431
graphene_conf.set('GRAPHENE_STATIC_COMPILATION', '1')
428432
endif
429433

430-
434+
message('importing python and gnome')
431435
python = import('python')
432436
gnome = import('gnome')
433-
437+
message('subdir include')
434438
subdir('include')
435439

440+
message('include_directories src')
436441
src_inc = include_directories('src')
442+
message('subdir src')
437443
subdir('src')
438444

445+
message('get_option tests')
439446
if get_option('tests')
440447
if cc.get_id() == 'msvc' and cc.version().version_compare('<19')
441448
warning('Tests, specifically the mutest library, cannot be built for pre-2015 Visual Studio builds.')
442449
warning('Use \'meson configure -Dtests=false\' if you are sure you want to proceed.')
443450
endif
444451
subdir('tests')
445452
endif
446-
453+
message('get_option gtk_doc')
447454
if get_option('gtk_doc')
448455
subdir('doc')
449456
endif

src/meson.build

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
message('in src/meson.build')
12
sources = [
23
'graphene-alloc.c',
34
'graphene-box.c',
@@ -22,23 +23,26 @@ simd_sources = [
2223
'graphene-simd4f.c',
2324
'graphene-simd4x4f.c',
2425
]
25-
26+
message('if build_gobject 1')
2627
if build_gobject
2728
sources += [ 'graphene-gobject.c' ]
2829
endif
2930

3031
# Internal configuration header
32+
message('configure_file')
3133
configure_file(
3234
output: 'config.h',
3335
configuration: conf,
3436
)
3537

3638
platform_deps = []
3739

40+
message('if build_gobject 2')
3841
if build_gobject
3942
platform_deps += gobject
4043
endif
4144

45+
message('library libgraphene')
4246
libgraphene = library(
4347
graphene_api_path,
4448
include_directories: graphene_inc,
@@ -55,10 +59,12 @@ libgraphene = library(
5559
link_args: common_ldflags,
5660
)
5761

62+
message('foreach simd')
5863
foreach simd: [ 'sse2', 'gcc', 'neon', 'scalar', ]
5964
set_variable('has_' + simd, graphene_simd.contains(simd) ? '1' : '0')
6065
endforeach
6166

67+
message('import pkgconfig')
6268
pkgconfig = import('pkgconfig')
6369
pkgconfig.generate(
6470
libgraphene,
@@ -78,6 +84,7 @@ pkgconfig.generate(
7884
] + sse2_cflags + neon_cflags,
7985
)
8086

87+
message('if build_gobject 3')
8188
if build_gobject
8289
pkgconfig.generate(
8390
name: 'Graphene-GObject',
@@ -98,18 +105,20 @@ endif
98105
graphene_dep_sources = []
99106

100107
# Introspection
108+
message('if build_gir')
101109
if build_gir
110+
message('python.find_installation')
102111
python = python.find_installation()
103112
identfilter_py = meson.current_source_dir() / 'identfilter.py'
104113

105114
gir_extra_args = [
106115
'--identifier-filter-cmd=@0@ "@1@"'.format(python.full_path(), identfilter_py),
107116
'--accept-unprefixed',
108-
'--quiet',
117+
# '--quiet',
109118
'--warn-all',
110119
'-DGRAPHENE_COMPILATION',
111120
]
112-
121+
message('gnome.generate_gir')
113122
graphene_gir = gnome.generate_gir(libgraphene,
114123
include_directories: graphene_inc,
115124
sources: [graphene_config_h] + sources + graphene_public_headers,
@@ -128,14 +137,18 @@ if build_gir
128137
endif
129138

130139
# Dependency for tests and subproject usage
140+
message('declare_dependency')
131141
graphene_dep = declare_dependency(
132142
sources: graphene_dep_sources,
133143
link_with: libgraphene,
134144
include_directories: [ graphene_inc ],
135145
dependencies: [ mathlib, threadlib ] + platform_deps,
136146
)
147+
message('override_dependency graphene-1.0')
137148
meson.override_dependency('graphene-1.0', graphene_dep)
149+
message('if build_gobject 4')
138150
if build_gobject
151+
message('override_dependency graphene-gobject-1.0')
139152
meson.override_dependency('graphene-gobject-1.0', graphene_dep)
140153
endif
141154

@@ -144,8 +157,10 @@ endif
144157
# directly as part of the dependency() fallback logic instead of having to
145158
# poke at the build_gobject subproject variable. This mirrors the pkg-config
146159
# lookup logic where we have a dedicated .pc file for graphene-gobject as well.
160+
message('if build_gobject 5')
147161
if build_gobject
148162
graphene_gobject_dep = graphene_dep
149163
else
150164
graphene_gobject_dep = dependency('', required: false)
151165
endif
166+
message('exit src/meson.build')

tests/meson.build

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
message('In tests/meson.build')
12
unit_tests = [
23
'box',
34
'box2d',
@@ -20,8 +21,10 @@ unit_tests = [
2021
'vec4'
2122
]
2223

24+
message('find "gen-installed-test.py"')
2325
gen_installed_test = find_program('gen-installed-test.py')
2426

27+
message('build paths')
2528
installed_test_datadir = get_option('prefix') / get_option('datadir') / 'installed-tests' / graphene_api_path
2629
installed_test_bindir = get_option('prefix') / get_option('libexecdir') / 'installed-tests' / graphene_api_path
2730

@@ -33,7 +36,7 @@ mutest_dep = dependency('mutest-1',
3336
required: false,
3437
disabler: true,
3538
)
36-
39+
message('if mutest_dep.found')
3740
if mutest_dep.found()
3841
foreach unit: unit_tests
3942
wrapper = '@0@.test'.format(unit)
@@ -65,8 +68,8 @@ if mutest_dep.found()
6568
endif
6669

6770
src_build_path = meson.current_build_dir() / '../src'
68-
69-
if build_gir and host_system == 'linux' and not meson.is_cross_build()
71+
message('if build_gir and not meson.is_cross_build')
72+
if build_gir and not meson.is_cross_build()
7073
foreach unit: ['introspection.py']
7174
if get_option('installed_tests')
7275
install_data(unit, install_dir: installed_test_bindir)

0 commit comments

Comments
 (0)