From 7fa9b153486edc6aa0ff53b91dad8e3aa6145768 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Fri, 20 May 2022 14:29:47 +0300 Subject: [PATCH] build: consolidate lcms2 dependencies It's bad form to set the same variable in multiple places, and not all of them were even equivalent. Move lcms2 finding to the root level build file only. It is still an optional dependency like before, and the if-not-found checks are still in place where actually needed. Signed-off-by: Pekka Paalanen --- compositor/meson.build | 5 ++--- libweston/color-lcms/meson.build | 1 - meson.build | 2 ++ tests/meson.build | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/compositor/meson.build b/compositor/meson.build index 427167e7..eb3c9de5 100644 --- a/compositor/meson.build +++ b/compositor/meson.build @@ -97,18 +97,17 @@ if get_option('screenshare') endif if get_option('color-management-lcms') - config_h.set('HAVE_LCMS', '1') - srcs_lcms = [ 'cms-static.c', 'cms-helper.c', ] - dep_lcms2 = dependency('lcms2', required: false) if not dep_lcms2.found() error('cms-static requires lcms2 which was not found. Or, you can use \'-Dcolor-management-lcms=false\'.') endif + config_h.set('HAVE_LCMS', '1') + plugin_lcms = shared_library( 'cms-static', srcs_lcms, diff --git a/libweston/color-lcms/meson.build b/libweston/color-lcms/meson.build index 86e2871f..4aefd4b3 100644 --- a/libweston/color-lcms/meson.build +++ b/libweston/color-lcms/meson.build @@ -2,7 +2,6 @@ if not get_option('color-management-lcms') subdir_done() endif -dep_lcms2 = dependency('lcms2', version: '>= 2.9', required: false) if not dep_lcms2.found() error('color-lcms plugin requires lcms2 which was not found. Or, you can use \'-Dcolor-management-lcms=false\'.') endif diff --git a/meson.build b/meson.build index 47324bd8..994c7a56 100644 --- a/meson.build +++ b/meson.build @@ -158,6 +158,8 @@ if dep_libdrm_version.version_compare('>=2.4.107') config_h.set('HAVE_HUMAN_FORMAT_MODIFIER', '1') endif +dep_lcms2 = dependency('lcms2', version: '>= 2.9', required: false) + prog_python = import('python').find_installation('python3') files_xxd_py = files('tools/xxd.py') cmd_xxd = [ prog_python, files_xxd_py, '@INPUT@', '@OUTPUT@' ] diff --git a/tests/meson.build b/tests/meson.build index 388dcc9a..4dfd57e9 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -239,7 +239,6 @@ if get_option('renderer-gl') endif if get_option('color-management-lcms') - dep_lcms2 = dependency('lcms2', version: '>= 2.9', required: false) if not dep_lcms2.found() error('color-management-lcms tests require lcms2 which was not found. Or, you can use \'-Dcolor-management-lcms=false\'.') endif