Re: [PATCH xserver 2/2] meson: Use dependency version_compare()

2017-09-20 Thread Eric Anholt
Daniel Stone  writes:

> We can check the version on an existing dependency, rather than spinning
> up pkg-config again just to check the right version.
>
> Signed-off-by: Daniel Stone 
> ---
>  include/meson.build | 7 +++
>  meson.build | 3 ---
>  2 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/include/meson.build b/include/meson.build
> index 05ef76930..5eefc5f07 100644
> --- a/include/meson.build
> +++ b/include/meson.build
> @@ -72,13 +72,12 @@ conf_data.set_quoted('SHMDIR', '/tmp')
>  conf_data.set('HAVE_XSHMFENCE', xshmfence_dep.found())
>  conf_data.set('WITH_LIBDRM', libdrm_dep.found())
>  conf_data.set('GLAMOR_HAS_DRM_NAME_FROM_FD_2',
> -  dependency('libdrm', version: '>= 2.4.74', required: 
> false).found())
> +  libdrm_dep.found() and 
> libdrm_dep.version().version_compare('>= 2.4.74'))

nirbheek says there's a meson patch to be merged soon that handles the
caching of pkg-config outputs automatically so you don't need to do this
dep.found() and dep.version().version_compare() dance.  That said,
you've reduced the build system complexity with the rest of this patch,
so:

Reviewed-by: Eric Anholt 


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 2/2] meson: Use dependency version_compare()

2017-09-20 Thread Adam Jackson
On Wed, 2017-09-20 at 07:22 -0700, Daniel Stone wrote:
> We can check the version on an existing dependency, rather than spinning
> up pkg-config again just to check the right version.

Merged, thanks:

remote: I: patch #177948 updated using rev 
86a89dd6020f59964c0e924acbfae9d5a51e3148.
remote: I: patch #177949 updated using rev 
d770f9293296d2d3c4e49e94130ff68c0890f625.
remote: I: 2 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   294670682..d770f9293  master -> master

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 2/2] meson: Use dependency version_compare()

2017-09-20 Thread Daniel Stone
We can check the version on an existing dependency, rather than spinning
up pkg-config again just to check the right version.

Signed-off-by: Daniel Stone 
---
 include/meson.build | 7 +++
 meson.build | 3 ---
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/include/meson.build b/include/meson.build
index 05ef76930..5eefc5f07 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -72,13 +72,12 @@ conf_data.set_quoted('SHMDIR', '/tmp')
 conf_data.set('HAVE_XSHMFENCE', xshmfence_dep.found())
 conf_data.set('WITH_LIBDRM', libdrm_dep.found())
 conf_data.set('GLAMOR_HAS_DRM_NAME_FROM_FD_2',
-  dependency('libdrm', version: '>= 2.4.74', required: 
false).found())
+  libdrm_dep.found() and libdrm_dep.version().version_compare('>= 
2.4.74'))
 conf_data.set('GLXEXT', build_glx)
 conf_data.set('GLAMOR', build_glamor)
 conf_data.set('GLAMOR_HAS_GBM', gbm_dep.found())
-if gbm_dep.found() and dependency('gbm', version: '>= 10.6', required: 
false).found()
-conf_data.set('GLAMOR_HAS_GBM_LINEAR', build_glamor)
-endif
+conf_data.set('GLAMOR_HAS_GBM_LINEAR',
+  gbm_dep.found() and gbm_dep.version().version_compare('>= 10.6'))
 
 conf_data.set_quoted('SERVER_MISC_CONFIG_PATH', serverconfigdir)
 conf_data.set_quoted('PROJECTROOT', get_option('prefix'))
diff --git a/meson.build b/meson.build
index 3efec0def..4bfe9ee5e 100644
--- a/meson.build
+++ b/meson.build
@@ -210,9 +210,6 @@ endif
 gbm_dep = dependency('', required:false)
 if build_glamor
 gbm_dep = dependency('gbm', version: '>= 10.2', required: false)
-if gbm_dep.found()
-gbm_linear_dep = dependency('gbm', version: '>= 10.6', required: false)
-endif
 endif
 
 # XXX: Add more sha1 options, because Linux is about choice
-- 
2.14.1

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel