Commit d8d16562 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠
Browse files

meson: fix macOS build and add macOS ci

Fixes #441
parent cb3618f7
......@@ -213,3 +213,29 @@ meson android arm64 fedora:
EOF
- meson setup --cross-file android-cross-file.txt build
- meson compile --verbose -C build
meson macOS:
tags:
- gst-macos-10.15
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
expire_in: '5 days'
when: 'always'
paths:
- "build/meson-logs/*txt"
- "build/meson-private/*pc"
before_script:
- pip3 install --upgrade pip
# Make sure meson is up to date
- pip3 install -U meson
# Need to install certificates for python
- pip3 install --upgrade certifi
# Anther way to install certificates
- open /Applications/Python\ 3.8/Install\ Certificates.command
# Get ninja
- pip3 install -U ninja
script:
- CERT_PATH=$(python3 -m certifi) && export SSL_CERT_FILE=${CERT_PATH} && export REQUESTS_CA_BUNDLE=${CERT_PATH}
# pixman region-test fails to link on macOS
- meson setup -Dpixman:tests=disabled build
- meson compile --verbose -C build
......@@ -371,37 +371,34 @@ if qtgui_dep.found() and false
deps += [qtgui_dep]
endif
# Untested
if cc.has_header('ApplicationServices/ApplicationServices.h')
if cc.has_header('CoreGraphics/CoreGraphics.h')
quartz_extra_libs = ['-Xlinker', '-framework', '-Xlinker', 'CoreGraphics']
else
quartz_extra_libs = ['-Xlinker', '-framework', '-Xlinker', 'ApplicationServices']
if host_machine.system() == 'darwin' and not get_option('quartz').disabled()
quartz_deps = dependency('appleframeworks', modules : ['CoreFoundation', 'ApplicationServices'], required: get_option('quartz'))
if quartz_deps.found()
deps += [quartz_deps]
feature_conf.set('CAIRO_HAS_QUARTZ_SURFACE', 1)
feature_conf.set('CAIRO_HAS_QUARTZ_FONT', 1)
feature_conf.set('CAIRO_HAS_QUARTZ_IMAGE_SURFACE', 1)
built_features += [
{
'name': 'cairo-quartz',
'description': 'Quartz surface backend',
'deps': quartz_deps,
},
{
'name': 'cairo-quartz-image',
'description': 'Quartz Image surface backend',
'deps': quartz_deps,
},
{
'name': 'cairo-quartz-font',
'description': 'Quartz font backend',
'deps': quartz_deps,
},
]
endif
extra_link_args += quartz_extra_libs
feature_conf.set('CAIRO_HAS_QUARTZ_SURFACE', 1)
feature_conf.set('CAIRO_HAS_QUARTZ_FONT', 1)
feature_conf.set('CAIRO_HAS_QUARTZ_IMAGE_SURFACE', 1)
built_features += [
{
'name': 'cairo-quartz',
'description': 'Quartz surface backend',
'libs': quartz_extra_libs,
},
{
'name': 'cairo-quartz-image',
'description': 'Quartz Image surface backend',
'libs': quartz_extra_libs,
},
{
'name': 'cairo-quartz-font',
'description': 'Quartz font backend',
'libs': quartz_extra_libs,
},
]
endif
if host_machine.system() == 'windows'
......@@ -887,13 +884,13 @@ foreach feature: built_features
feature_deps = feature.get('deps', [])
feature_libs = feature.get('libs', [])
feature_compile_deps = feature.get('compile-deps', [])
pkgmod.generate(libraries: [libcairo] + feature_deps + feature_libs,
pkgmod.generate(libraries: [libcairo, feature_deps, feature_libs],
name: feature['name'],
description: feature['description'] + ' for cairo graphics library',
)
meson.override_dependency(feature['name'],
declare_dependency(link_with: libcairo,
dependencies: feature_deps + feature_compile_deps,
dependencies: [feature_deps, feature_compile_deps],
link_args: feature_libs,
)
)
......
......@@ -13,6 +13,7 @@ option('glesv3', type : 'feature', value : 'disabled')
option('drm', type : 'feature', value : 'disabled')
option('openvg', type : 'feature', value : 'disabled')
option('png', type : 'feature', value : 'auto') # png and svg surfaces
option('quartz', type : 'feature', value : 'auto')
option('qt', type : 'feature', value : 'disabled')
option('tee', type : 'feature', value : 'disabled')
option('xcb', type : 'feature', value : 'auto')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment