From 15e066861633f36ac00e5b381f9c808e024ad74d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 30 May 2020 13:24:46 +0100 Subject: meson: add cpu-features-path option for Android Add option to include cpu-features.[ch] from a given path into the build for platforms that don't provide this out of the box. This is needed on Android. Reviewed-by: Dylan Baker --- meson_options.txt | 5 +++++ pixman/meson.build | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/meson_options.txt b/meson_options.txt index 79ff4a3..008701b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -74,6 +74,11 @@ option( type : 'feature', description : 'Use GNU style inline assembler', ) +option( + 'cpu-features-path', + type : 'string', + description : 'Path to platform-specific cpu-features.[ch] for systems that do not provide it (e.g. Android)', +) option( 'openmp', type : 'feature', diff --git a/pixman/meson.build b/pixman/meson.build index f48357f..aab97e1 100644 --- a/pixman/meson.build +++ b/pixman/meson.build @@ -102,6 +102,19 @@ pixman_files = files( 'pixman-utils.c', ) +# Android cpu-features +cpu_features_path = get_option('cpu-features-path') +cpu_features_sources = [] +cpu_features_inc = [] +if cpu_features_path != '' + message('Using cpu-features.[ch] from ' + cpu_features_path) + cpu_features_sources = files( + cpu_features_path / 'cpu-features.h', + cpu_features_path / 'cpu-features.c', + ) + cpu_features_inc = include_directories(cpu_features_path) +endif + # We cannot use 'link_with' or 'link_whole' because meson wont do the right # thing for static archives. _obs = [] @@ -111,10 +124,11 @@ endforeach libpixman = library( 'pixman-1', - [pixman_files, config_h, version_h], + [pixman_files, config_h, version_h, cpu_features_sources], objects : _obs, c_args : libpixman_extra_cargs, dependencies : [dep_m, dep_threads], + include_directories : cpu_features_inc, version : meson.project_version(), install : true, ) -- cgit v1.2.1