OSDN Git Service

update NEWS for libva 2.4.0
[android-x86/hardware-intel-common-libva.git] / meson.build
1 # libva package version number, (as distinct from shared library version)
2 # XXX: we want the package version to remain at 1.0.x for VA-API 0.32.y
3 #
4 # - major version is automatically generated from VA-API major version
5 # - minor version is automatically generated from VA-API minor version
6 # - increment micro for any library release
7 # - reset micro version to zero when VA-API major or minor version is changed
8 project(
9   'libva', 'c',
10   version : '2.4.0.1',
11   meson_version : '>= 0.37.0',
12   default_options : [ 'warning_level=1',
13                       'buildtype=debugoptimized' ])
14
15 # VA-API version
16 # - increment major for any ABI change
17 # - increment minor for any interface change (e.g. new/modified function)
18 # - increment micro for any other change (new flag, new codec definition, etc.)
19 # - reset micro version to zero when minor version is incremented
20 # - reset minor version to zero when major version is incremented
21 va_api_major_version = 1
22 va_api_minor_version = 4
23 va_api_micro_version = 0
24
25 va_api_version = '@0@.@1@.@2@'.format(va_api_major_version,
26                                       va_api_minor_version,
27                                       va_api_micro_version)
28
29 version_arr = meson.project_version().split('.')
30 libva_major_version = version_arr[0]
31 libva_minor_version = version_arr[1]
32 libva_micro_version = version_arr[2]
33 libva_version = '@0@.@1@.@2@'.format(libva_major_version,
34                                      libva_minor_version,
35                                      libva_micro_version)
36 if version_arr.length() == 4
37   libva_version = '@0@.pre@1@'.format(libva_version, version_arr[3])
38 endif
39
40
41 # libva library version number (generated, do not change)
42 # XXX: we want the SONAME to remain at libva.so.1 for VA-API major == 0
43 #
44 # The library name is generated libva.<x>.<y>.0 where
45 # <x> = VA-API major version + 1
46 # <y> = 100 * VA-API minor version + VA-API micro version
47 #
48 # For example:
49 # VA-API 0.32.0 generates libva.so.1.3200.0
50 # VA-API 0.34.1 generates libva.so.1.3401.0
51 # VA-API 1.2.13 generates libva.so.2.213.0
52 libva_interface_bias = va_api_major_version + 1
53 libva_interface_age = 0
54 libva_binary_age = 100 * va_api_minor_version + va_api_micro_version - libva_interface_age
55
56 libva_lt_current = 100 * va_api_minor_version + va_api_micro_version + libva_interface_bias
57 libva_lt_revision = libva_interface_age
58 libva_lt_age = libva_binary_age - libva_interface_age
59
60 libva_lt_current = libva_lt_current - libva_lt_age
61
62 libva_lt_version = '@0@.@1@.@2@'.format(libva_lt_current,
63                                         libva_lt_age,
64                                         libva_lt_revision)
65
66 driverdir = get_option('driverdir')
67 if driverdir == ''
68   driverdir = '@0@/@1@/@2@'.format(get_option('prefix'), get_option('libdir'), 'dri')
69 endif
70
71 configinc = include_directories('.')
72
73 cc = meson.get_compiler('c')
74 dl_dep = cc.find_library('dl', required : false)
75
76 libdrm_dep = dependency('libdrm', version : '>= 2.4')
77
78 WITH_DRM = not get_option('disable_drm')
79
80 WITH_X11 = false
81 if get_option('with_x11') != 'no'
82   x11_dep = dependency('x11', required : get_option('with_x11') == 'yes')
83   xext_dep = dependency('xext', required : get_option('with_x11') == 'yes')
84   xfixes_dep = dependency('xfixes', required : get_option('with_x11') == 'yes')
85
86   WITH_X11 = (x11_dep.found() and xext_dep.found() and xfixes_dep.found())
87 endif
88
89 if not WITH_X11 and get_option('with_glx') == 'yes'
90   error('VA/GLX explicitly enabled, but VA/X11 isn\'t built')
91 endif
92
93 WITH_GLX = false
94 if WITH_X11 and get_option('with_glx') != 'no'
95   gl_dep = dependency('gl', required : get_option('with_glx') == 'yes')
96   WITH_GLX = gl_dep.found()
97 endif
98
99 WITH_WAYLAND = false
100 if get_option('with_wayland') != 'no'
101   wayland_dep = dependency('wayland-client', version : '>= 1.11.0',
102                            required : get_option('with_wayland') == 'yes')
103   if wayland_dep.found()
104     prefix = wayland_dep.get_pkgconfig_variable('prefix')
105     wl_scanner = find_program('wayland-scanner',
106                               prefix + '/bin/wayland-scanner')
107   endif
108   WITH_WAYLAND = wayland_dep.found()
109 endif
110
111
112 if (not WITH_DRM and not WITH_X11 and not WITH_WAYLAND)
113   error('Please install at least one backend dev files (DRM, X11, Wayland)')
114 endif
115
116 subdir('va')
117 subdir('pkgconfig')
118
119 doxygen = find_program('doxygen', required: false)
120
121 if get_option('enable_docs') and doxygen.found()
122   subdir('doc')
123 endif