meson: use -imacros to include config.h

This is for unmodified Mesa util code to get the definitions.  It is
possible to modify the Mesa util code if that is preferred.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Chia-I Wu 3 years ago
parent 8dc262c7ad
commit 1301ea0611
  1. 2
      config.h.meson
  2. 11
      meson.build

@ -1,4 +1,6 @@
#mesondefine VERSION #mesondefine VERSION
#mesondefine _GNU_SOURCE
#mesondefine VIRGL_RENDERER_UNSTABLE_APIS
#mesondefine HAVE_SYS_UIO_H #mesondefine HAVE_SYS_UIO_H
#mesondefine HAVE_PTHREAD #mesondefine HAVE_PTHREAD
#mesondefine HAVE_EPOXY_EGL_H #mesondefine HAVE_EPOXY_EGL_H

@ -25,7 +25,7 @@ project(
'virglrenderer', 'c', 'virglrenderer', 'c',
version: '0.9.0', version: '0.9.0',
license : 'MIT', license : 'MIT',
meson_version : '>= 0.46', meson_version : '>= 0.49',
default_options : ['buildtype=release', 'b_ndebug=if-release', default_options : ['buildtype=release', 'b_ndebug=if-release',
'warning_level=3', 'c_std=gnu11'] 'warning_level=3', 'c_std=gnu11']
) )
@ -44,10 +44,6 @@ revision = 3
cc = meson.get_compiler('c') cc = meson.get_compiler('c')
add_project_arguments('-DHAVE_CONFIG_H=1', language : 'c')
add_project_arguments('-D_GNU_SOURCE=1', language : 'c')
add_project_arguments('-DVIRGL_RENDERER_UNSTABLE_APIS', language : 'c')
warnings = [ warnings = [
'-Werror=implicit-function-declaration', '-Werror=implicit-function-declaration',
'-Werror=missing-prototypes', '-Werror=missing-prototypes',
@ -81,6 +77,8 @@ m_dep = cc.find_library('m')
conf_data = configuration_data() conf_data = configuration_data()
conf_data.set('VERSION', '0.8.1') conf_data.set('VERSION', '0.8.1')
conf_data.set('_GNU_SOURCE', 1)
conf_data.set('VIRGL_RENDERER_UNSTABLE_APIS', 1)
with_tracing = get_option('tracing') with_tracing = get_option('tracing')
@ -226,6 +224,9 @@ configure_file(input : 'config.h.meson',
output : 'config.h', output : 'config.h',
configuration : conf_data) configuration : conf_data)
add_project_arguments('-imacros', meson.build_root() / 'config.h', language : 'c')
add_project_arguments('-DHAVE_CONFIG_H=1', language : 'c')
pkgconf_data = configuration_data() pkgconf_data = configuration_data()
pkgconf_data.set('PACKAGE_VERSION', meson.project_version()) pkgconf_data.set('PACKAGE_VERSION', meson.project_version())
pkgconf_data.set('prefix', get_option('prefix')) pkgconf_data.set('prefix', get_option('prefix'))

Loading…
Cancel
Save