diff mbox

[libdrm,4/4] meson: replace `if(compiles) have=true` with `have=compiles`

Message ID 20180316171227.2968-4-eric.engestrom@imgtec.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Engestrom March 16, 2018, 5:12 p.m. UTC
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
---
 meson.build | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Dylan Baker March 16, 2018, 9:15 p.m. UTC | #1
Quoting Eric Engestrom (2018-03-16 10:12:27)
> Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
> ---
>  meson.build | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 0fe04a1411963c70cf80..74a541e8d835ae27c7f4 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -187,9 +187,8 @@ else
>  endif
>  dep_m = cc.find_library('m', required : false)
>  foreach header : ['sys/sysctl.h', 'sys/select.h', 'alloca.h']
> -  if cc.compiles('#include <@0@>'.format(header), name : '@0@ works'.format(header))
> -    config.set10('HAVE_' + header.underscorify().to_upper(), true)
> -  endif
> +  config.set('HAVE_' + header.underscorify().to_upper(),
> +    cc.compiles('#include <@0@>'.format(header), name : '@0@ works'.format(header)))
>  endforeach
>  if cc.has_header_symbol('sys/sysmacros.h', 'major')
>    config.set10('MAJOR_IN_SYSMACROS', true)
> -- 
> Cheers,
>   Eric
> 

for the series:
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
diff mbox

Patch

diff --git a/meson.build b/meson.build
index 0fe04a1411963c70cf80..74a541e8d835ae27c7f4 100644
--- a/meson.build
+++ b/meson.build
@@ -187,9 +187,8 @@  else
 endif
 dep_m = cc.find_library('m', required : false)
 foreach header : ['sys/sysctl.h', 'sys/select.h', 'alloca.h']
-  if cc.compiles('#include <@0@>'.format(header), name : '@0@ works'.format(header))
-    config.set10('HAVE_' + header.underscorify().to_upper(), true)
-  endif
+  config.set('HAVE_' + header.underscorify().to_upper(),
+    cc.compiles('#include <@0@>'.format(header), name : '@0@ works'.format(header)))
 endforeach
 if cc.has_header_symbol('sys/sysmacros.h', 'major')
   config.set10('MAJOR_IN_SYSMACROS', true)