diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2020-05-30 13:24:46 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2020-06-02 01:15:33 +0100 |
commit | 15e066861633f36ac00e5b381f9c808e024ad74d (patch) | |
tree | e62f4fb47bd3f34ca461e973683373265e2f8e46 | |
parent | 0ba6cbe1ac0521378ff3dc82b78ad9305bc684b5 (diff) | |
download | pixman-15e066861633f36ac00e5b381f9c808e024ad74d.tar.gz |
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 <dylan@pnwbakers.com>
-rw-r--r-- | meson_options.txt | 5 | ||||
-rw-r--r-- | pixman/meson.build | 16 |
2 files changed, 20 insertions, 1 deletions
diff --git a/meson_options.txt b/meson_options.txt index 79ff4a3..008701b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -75,6 +75,11 @@ option( 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', description : 'Enable openmp support', 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, ) |