Arkadiusz Hiler | eccae13 | 2018-05-15 14:07:50 +0300 | [diff] [blame] | 1 | project('igt-gpu-tools', 'c', |
Petri Latvala | 22850c1 | 2019-06-20 14:52:12 +0300 | [diff] [blame] | 2 | version : '1.24', |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 3 | default_options: [ |
| 4 | 'warning_level=2', |
Lucas De Marchi | 523bc59 | 2018-06-06 15:27:39 -0700 | [diff] [blame] | 5 | 'c_std=gnu11', |
Arkadiusz Hiler | efec5d2 | 2019-05-07 14:52:09 +0300 | [diff] [blame] | 6 | 'b_ndebug=false', |
| 7 | 'buildtype=debugoptimized', |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 8 | ], |
Daniel Vetter | 866970a | 2017-09-05 14:36:24 +0200 | [diff] [blame] | 9 | license : 'MIT', |
Arkadiusz Hiler | 736b099 | 2019-05-21 12:36:01 +0300 | [diff] [blame] | 10 | meson_version : '>=0.47.0') |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 11 | |
Lyude Paul | 3f26aa3 | 2019-04-24 14:48:35 -0400 | [diff] [blame] | 12 | if get_option('b_ndebug') != 'false' |
| 13 | error('Building without -Db_ndebug=false is not supported') |
| 14 | endif |
| 15 | |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 16 | cc = meson.get_compiler('c') |
| 17 | |
Lyude Paul | 3f26aa3 | 2019-04-24 14:48:35 -0400 | [diff] [blame] | 18 | # Also make sure that the user doesn't have -DNDEBUG defined in their config |
| 19 | if not cc.compiles(files('lib/check-ndebug.h'), args: get_option('c_args')) |
| 20 | error('Building with NDEBUG defined is not supported') |
| 21 | endif |
| 22 | |
Daniel Vetter | c4614fe | 2017-09-05 14:36:20 +0200 | [diff] [blame] | 23 | cc_args = [ |
Petri Latvala | 7fd5da2 | 2018-10-29 16:30:54 +0200 | [diff] [blame] | 24 | '-Wbad-function-cast', |
| 25 | '-Wdeclaration-after-statement', |
| 26 | '-Wformat=2', |
Eric Anholt | cae05d9 | 2017-09-05 14:36:17 +0200 | [diff] [blame] | 27 | # igt_assert(0) in switch statements triggers a bunch of this. |
Daniel Vetter | c4614fe | 2017-09-05 14:36:20 +0200 | [diff] [blame] | 28 | '-Wimplicit-fallthrough=0', |
Petri Latvala | 7fd5da2 | 2018-10-29 16:30:54 +0200 | [diff] [blame] | 29 | '-Wlogical-op', |
| 30 | '-Wmissing-declarations', |
| 31 | '-Wmissing-format-attribute', |
| 32 | '-Wmissing-noreturn', |
| 33 | '-Wmissing-prototypes', |
| 34 | '-Wnested-externs', |
| 35 | '-Wold-style-definition', |
| 36 | '-Wpointer-arith', |
| 37 | '-Wredundant-decls', |
| 38 | '-Wshadow', |
| 39 | '-Wstrict-prototypes', |
| 40 | '-Wuninitialized', |
| 41 | '-Wunused', |
| 42 | |
| 43 | '-Wno-clobbered', |
| 44 | '-Wno-maybe-uninitialized', |
| 45 | '-Wno-missing-field-initializers', |
| 46 | '-Wno-pointer-arith', |
| 47 | '-Wno-sign-compare', |
| 48 | # Macros asserting on the range of their arguments triggers this. |
| 49 | '-Wno-type-limits', |
| 50 | '-Wno-unused-parameter', |
| 51 | '-Wno-unused-result', |
| 52 | |
| 53 | '-Werror=address', |
| 54 | '-Werror=array-bounds', |
| 55 | '-Werror=implicit', |
| 56 | '-Werror=init-self', |
| 57 | '-Werror=int-to-pointer-cast', |
| 58 | '-Werror=main', |
| 59 | '-Werror=missing-braces', |
| 60 | '-Werror=nonnull', |
| 61 | '-Werror=pointer-to-int-cast', |
| 62 | '-Werror=return-type', |
| 63 | '-Werror=sequence-point', |
| 64 | '-Werror=trigraphs', |
| 65 | '-Werror=write-strings', |
Arkadiusz Hiler | 615c756 | 2019-05-08 11:09:42 +0300 | [diff] [blame] | 66 | # Disable the memory allocating builtins as they may cause unexpected behavior |
| 67 | # with our framework. They *may* get optimized out in favor of a register or |
| 68 | # stack variable, making them effectively local. Local variables do not play |
| 69 | # well with longjmp which is heavily used by IGT framework. |
| 70 | '-fno-builtin-malloc', |
| 71 | '-fno-builtin-calloc', |
Daniel Vetter | c4614fe | 2017-09-05 14:36:20 +0200 | [diff] [blame] | 72 | ] |
| 73 | |
| 74 | foreach cc_arg : cc_args |
| 75 | if cc.has_argument(cc_arg) |
| 76 | add_global_arguments(cc_arg, language : 'c') |
| 77 | endif |
| 78 | endforeach |
Eric Anholt | cae05d9 | 2017-09-05 14:36:17 +0200 | [diff] [blame] | 79 | |
Simon Ser | 0ea68a1 | 2019-07-05 16:42:23 +0300 | [diff] [blame] | 80 | build_chamelium = get_option('chamelium') |
| 81 | build_docs = get_option('docs') |
| 82 | build_tests = not get_option('tests').disabled() |
| 83 | with_libdrm = get_option('libdrm_drivers') |
Petri Latvala | 0e98bf6 | 2018-06-21 14:06:25 +0300 | [diff] [blame] | 84 | |
Arkadiusz Hiler | efec5d2 | 2019-05-07 14:52:09 +0300 | [diff] [blame] | 85 | build_info = ['Build type: ' + get_option('buildtype')] |
Petri Latvala | 0e98bf6 | 2018-06-21 14:06:25 +0300 | [diff] [blame] | 86 | |
Lucas De Marchi | 31ea7dd | 2018-07-24 15:20:23 -0700 | [diff] [blame] | 87 | inc = include_directories('include/drm-uapi', 'lib', 'lib/stubs/syscalls', '.') |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 88 | |
Daniel Vetter | 491e8c1 | 2017-12-05 11:16:49 +0100 | [diff] [blame] | 89 | inc_for_gtkdoc = include_directories('lib') |
| 90 | |
Daniel Vetter | 6e26225 | 2017-09-08 17:14:48 +0200 | [diff] [blame] | 91 | config = configuration_data() |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 92 | |
Petri Latvala | 0e98bf6 | 2018-06-21 14:06:25 +0300 | [diff] [blame] | 93 | null_dep = dependency('', required : false) |
| 94 | |
| 95 | libdrm_info = [] |
| 96 | libdrm_intel = null_dep |
| 97 | libdrm_nouveau = null_dep |
| 98 | libdrm_amdgpu = null_dep |
| 99 | |
Arkadiusz Hiler | 43d7c05 | 2018-03-08 13:25:44 +0200 | [diff] [blame] | 100 | libdrm_version = '>=2.4.82' |
| 101 | libdrm = dependency('libdrm', version : libdrm_version) |
Petri Latvala | 0e98bf6 | 2018-06-21 14:06:25 +0300 | [diff] [blame] | 102 | if with_libdrm.contains('auto') or with_libdrm.contains('intel') |
| 103 | libdrm_intel = dependency('libdrm_intel', version : libdrm_version, required : with_libdrm.contains('intel')) |
| 104 | libdrm_info += 'intel' |
| 105 | endif |
| 106 | if with_libdrm.contains('auto') or with_libdrm.contains('nouveau') |
| 107 | libdrm_nouveau = dependency('libdrm_nouveau', version : libdrm_version, required : with_libdrm.contains('nouveau')) |
| 108 | libdrm_info += 'nouveau' |
| 109 | endif |
| 110 | if with_libdrm.contains('auto') or with_libdrm.contains('amdgpu') |
| 111 | libdrm_amdgpu = dependency('libdrm_amdgpu', version : libdrm_version, required : with_libdrm.contains('amdgpu')) |
| 112 | libdrm_info += 'amdgpu' |
| 113 | endif |
| 114 | |
| 115 | build_info += 'With libdrm: ' + ','.join(libdrm_info) |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 116 | |
| 117 | pciaccess = dependency('pciaccess', version : '>=0.10') |
| 118 | libkmod = dependency('libkmod') |
Arkadiusz Hiler | 643dc09 | 2017-11-24 17:17:48 +0200 | [diff] [blame] | 119 | libprocps = dependency('libprocps', required : true) |
Daniel Vetter | 2908e4c | 2018-10-30 13:22:12 +0100 | [diff] [blame] | 120 | |
Simon Ser | 0ea68a1 | 2019-07-05 16:42:23 +0300 | [diff] [blame] | 121 | libunwind = dependency('libunwind', required : get_option('libunwind')) |
Arkadiusz Hiler | 736b099 | 2019-05-21 12:36:01 +0300 | [diff] [blame] | 122 | build_info += 'With libunwind: @0@'.format(libunwind.found()) |
Daniel Vetter | 2908e4c | 2018-10-30 13:22:12 +0100 | [diff] [blame] | 123 | |
Maarten Lankhorst | e39e099 | 2018-08-28 14:04:25 +0200 | [diff] [blame] | 124 | libdw = dependency('libdw', required : true) |
Maxime Ripard | ddb3828 | 2018-10-04 14:39:01 +0200 | [diff] [blame] | 125 | pixman = dependency('pixman-1', required : true) |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 126 | |
Simon Ser | 0ea68a1 | 2019-07-05 16:42:23 +0300 | [diff] [blame] | 127 | valgrind = dependency('valgrind', required : get_option('valgrind')) |
Arkadiusz Hiler | 736b099 | 2019-05-21 12:36:01 +0300 | [diff] [blame] | 128 | if valgrind.found() |
| 129 | config.set('HAVE_VALGRIND', 1) |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 130 | endif |
Arkadiusz Hiler | 736b099 | 2019-05-21 12:36:01 +0300 | [diff] [blame] | 131 | build_info += 'Valgrind annotations: @0@'.format(valgrind.found()) |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 132 | |
Arkadiusz Hiler | f9b6fd6 | 2018-02-20 11:00:22 +0200 | [diff] [blame] | 133 | cairo = dependency('cairo', version : '>1.12.0', required : true) |
Antonio Argenziano | d75e676 | 2018-02-23 15:14:40 -0800 | [diff] [blame] | 134 | libudev = dependency('libudev', required : true) |
Petri Latvala | 9bbfbb1 | 2018-06-21 14:06:24 +0300 | [diff] [blame] | 135 | glib = dependency('glib-2.0', required : true) |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 136 | |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 137 | xmlrpc = dependency('xmlrpc', required : false) |
| 138 | xmlrpc_util = dependency('xmlrpc_util', required : false) |
| 139 | xmlrpc_client = dependency('xmlrpc_client', required : false) |
| 140 | |
Jani Nikula | 1ae18b0 | 2017-10-24 11:14:14 +0300 | [diff] [blame] | 141 | xmlrpc_cmd = find_program('xmlrpc-c-config', required : false) |
| 142 | if not xmlrpc.found() and xmlrpc_cmd.found() |
| 143 | libs_cmd = run_command(xmlrpc_cmd, 'client', '--libs') |
| 144 | cflags_cmd = run_command(xmlrpc_cmd, 'client', '--cflags') |
Arkadiusz Hiler | 892abc6 | 2017-10-17 15:05:41 +0300 | [diff] [blame] | 145 | |
| 146 | if libs_cmd.returncode() == 0 and cflags_cmd.returncode() == 0 |
| 147 | xmlrpc = declare_dependency(compile_args: cflags_cmd.stdout().strip().split(), |
Simon Ser | 311baff | 2019-04-23 16:04:52 +0300 | [diff] [blame] | 148 | link_args : libs_cmd.stdout().strip().split()) |
Arkadiusz Hiler | 892abc6 | 2017-10-17 15:05:41 +0300 | [diff] [blame] | 149 | xmlrpc_util = declare_dependency() |
| 150 | xmlrpc_client = declare_dependency() |
| 151 | endif |
| 152 | endif |
| 153 | |
Arkadiusz Hiler | 736b099 | 2019-05-21 12:36:01 +0300 | [diff] [blame] | 154 | if build_chamelium.enabled() and not (xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found()) |
| 155 | error('Chamelium build forced and required dependency xmlrpc not found') |
| 156 | endif |
| 157 | |
| 158 | gsl = dependency('gsl', required : build_chamelium) |
| 159 | alsa = dependency('alsa', required : build_chamelium) |
| 160 | libcurl = dependency('libcurl', required : build_chamelium) |
| 161 | |
| 162 | if xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found() and gsl.found() and alsa.found() and libcurl.found() |
| 163 | config.set('HAVE_CHAMELIUM', 1) |
Simon Ser | 311baff | 2019-04-23 16:04:52 +0300 | [diff] [blame] | 164 | chamelium = declare_dependency(dependencies : [ |
| 165 | xmlrpc, |
| 166 | xmlrpc_util, |
| 167 | xmlrpc_client, |
| 168 | gsl, |
| 169 | alsa, |
Petri Latvala | eff5d0d | 2019-05-20 12:39:24 +0300 | [diff] [blame] | 170 | ]) |
Arkadiusz Hiler | 736b099 | 2019-05-21 12:36:01 +0300 | [diff] [blame] | 171 | else |
| 172 | chamelium = disabler() |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 173 | endif |
Arkadiusz Hiler | 736b099 | 2019-05-21 12:36:01 +0300 | [diff] [blame] | 174 | |
| 175 | build_info += 'Build Chamelium test: @0@'.format(chamelium.found()) |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 176 | |
| 177 | pthreads = dependency('threads') |
| 178 | math = cc.find_library('m') |
| 179 | realtime = cc.find_library('rt') |
| 180 | dlsym = cc.find_library('dl') |
| 181 | zlib = cc.find_library('z') |
| 182 | |
Guillaume Tucker | 70303d2 | 2019-06-24 17:22:33 +0100 | [diff] [blame] | 183 | if cc.links(''' |
| 184 | #include <stdint.h> |
| 185 | int main(void) { |
| 186 | uint32_t x32 = 0; |
| 187 | uint64_t x64 = 0; |
| 188 | __atomic_load_n(&x32, __ATOMIC_SEQ_CST); |
| 189 | __atomic_load_n(&x64, __ATOMIC_SEQ_CST); |
| 190 | return 0; |
| 191 | }''', name : 'built-in atomics') |
| 192 | libatomic = null_dep |
| 193 | else |
| 194 | libatomic = cc.find_library('atomic') |
| 195 | endif |
| 196 | |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 197 | if cc.has_header('linux/kd.h') |
Daniel Vetter | 6e26225 | 2017-09-08 17:14:48 +0200 | [diff] [blame] | 198 | config.set('HAVE_LINUX_KD_H', 1) |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 199 | endif |
| 200 | if cc.has_header('sys/kd.h') |
Daniel Vetter | 6e26225 | 2017-09-08 17:14:48 +0200 | [diff] [blame] | 201 | config.set('HAVE_SYS_KD_H', 1) |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 202 | endif |
| 203 | if cc.has_header('libgen.h') |
Daniel Vetter | 6e26225 | 2017-09-08 17:14:48 +0200 | [diff] [blame] | 204 | config.set('HAVE_LIBGEN_H', 1) |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 205 | endif |
| 206 | if cc.has_header('sys/io.h') |
Daniel Vetter | 6e26225 | 2017-09-08 17:14:48 +0200 | [diff] [blame] | 207 | config.set('HAVE_SYS_IO_H', 1) |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 208 | endif |
| 209 | if cc.has_header('cpuid.h') |
| 210 | # FIXME: Do we need the example link test from configure.ac? |
Daniel Vetter | 6e26225 | 2017-09-08 17:14:48 +0200 | [diff] [blame] | 211 | config.set('HAVE_CPUID_H', 1) |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 212 | endif |
Lyude Paul | ef7c18b | 2019-04-24 16:11:31 -0400 | [diff] [blame] | 213 | if cc.has_header_symbol('unistd.h', 'gettid', args : '-D_GNU_SOURCE') |
| 214 | config.set('HAVE_GETTID', 1) |
| 215 | endif |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 216 | |
| 217 | if cc.has_member('struct sysinfo', 'totalram', |
| 218 | prefix : '#include <sys/sysinfo.h>') |
Daniel Vetter | 6e26225 | 2017-09-08 17:14:48 +0200 | [diff] [blame] | 219 | config.set('HAVE_STRUCT_SYSINFO_TOTALRAM', 1) |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 220 | endif |
| 221 | |
Lucas De Marchi | bcb37a9 | 2018-07-24 15:20:24 -0700 | [diff] [blame] | 222 | have = cc.has_function('memfd_create', prefix : '''#include <sys/mman.h>''', args : '-D_GNU_SOURCE') |
| 223 | config.set10('HAVE_MEMFD_CREATE', have) |
| 224 | |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 225 | add_project_arguments('-D_GNU_SOURCE', language : 'c') |
| 226 | add_project_arguments('-include', 'config.h', language : 'c') |
| 227 | |
Arkadiusz Hiler | 5b51f9e | 2019-05-07 14:54:35 +0300 | [diff] [blame] | 228 | # FEATURE_TEST_MACROS(7) |
| 229 | # performs lightweight overflow checks on quite a few libc functions |
| 230 | # requires -O optimizations |
| 231 | if ['debugoptimized', 'release', 'minsize'].contains(get_option('buildtype')) |
| 232 | add_project_arguments('-D_FORTIFY_SOURCE=2', language : 'c') |
| 233 | endif |
| 234 | |
Daniel Vetter | 6e26225 | 2017-09-08 17:14:48 +0200 | [diff] [blame] | 235 | config.set('PACKAGE_NAME', meson.project_name()) |
| 236 | config.set_quoted('PACKAGE_VERSION', meson.project_version()) |
| 237 | config.set_quoted('PACKAGE', meson.project_name()) |
| 238 | config.set('PACKAGE_STRING', meson.project_name() + ' ' + meson.project_version()) |
| 239 | config.set_quoted('TARGET_CPU_PLATFORM', host_machine.cpu_family()) |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 240 | |
Daniel Vetter | 6e26225 | 2017-09-08 17:14:48 +0200 | [diff] [blame] | 241 | configure_file(output: 'config.h', install: false, configuration: config) |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 242 | |
Petri Latvala | 4ebf687 | 2018-01-15 13:14:56 +0200 | [diff] [blame] | 243 | prefix = get_option('prefix') |
| 244 | bindir = get_option('bindir') |
Arkadiusz Hiler | eccae13 | 2018-05-15 14:07:50 +0300 | [diff] [blame] | 245 | datadir = join_paths(get_option('datadir'), 'igt-gpu-tools') |
Petri Latvala | 4ebf687 | 2018-01-15 13:14:56 +0200 | [diff] [blame] | 246 | includedir = get_option('includedir') |
| 247 | libdir = get_option('libdir') |
Arkadiusz Hiler | eccae13 | 2018-05-15 14:07:50 +0300 | [diff] [blame] | 248 | libexecdir = join_paths(get_option('libexecdir'), 'igt-gpu-tools') |
Arkadiusz Hiler | 6cc5ebf | 2018-08-13 13:16:22 +0300 | [diff] [blame] | 249 | amdgpudir = join_paths(libexecdir, 'amdgpu') |
Petri Latvala | 4ebf687 | 2018-01-15 13:14:56 +0200 | [diff] [blame] | 250 | mandir = get_option('mandir') |
| 251 | pkgconfigdir = join_paths(libdir, 'pkgconfig') |
| 252 | |
Arkadiusz Hiler | 6cc5ebf | 2018-08-13 13:16:22 +0300 | [diff] [blame] | 253 | if get_option('use_rpath') |
| 254 | # Set up runpath for the test executables towards libigt.so. |
| 255 | # The path should be relative to $ORIGIN so the library is |
| 256 | # still found properly even if installed to a path other than |
| 257 | # prefix. |
| 258 | |
| 259 | # libdir and bindir are pathnames relative to prefix. meson |
| 260 | # enforces this. |
| 261 | |
| 262 | # 1. Start from the executable. |
| 263 | # 2. Executables are installed in certain dir. Add a .. for each |
| 264 | # directory name in it. |
| 265 | # 3. Add relative path to libdir. |
| 266 | |
| 267 | bindir_rpathdir = '$ORIGIN' |
| 268 | foreach p : bindir.split('/') |
| 269 | bindir_rpathdir = join_paths(bindir_rpathdir, '..') |
| 270 | endforeach |
| 271 | bindir_rpathdir = join_paths(bindir_rpathdir, libdir) |
| 272 | |
| 273 | libexecdir_rpathdir = '$ORIGIN' |
| 274 | foreach p : libexecdir.split('/') |
| 275 | libexecdir_rpathdir = join_paths(libexecdir_rpathdir, '..') |
| 276 | endforeach |
| 277 | libexecdir_rpathdir = join_paths(libexecdir_rpathdir, libdir) |
| 278 | |
| 279 | amdgpudir_rpathdir = '$ORIGIN' |
| 280 | foreach p : amdgpudir.split('/') |
| 281 | amdgpudir_rpathdir = join_paths(amdgpudir_rpathdir, '..') |
| 282 | endforeach |
| 283 | amdgpudir_rpathdir = join_paths(amdgpudir_rpathdir, libdir) |
| 284 | else |
| 285 | bindir_rpathdir = '' |
| 286 | libexecdir_rpathdir = '' |
| 287 | amdgpudir_rpathdir = '' |
| 288 | endif |
| 289 | |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 290 | subdir('lib') |
Arkadiusz Hiler | 736b099 | 2019-05-21 12:36:01 +0300 | [diff] [blame] | 291 | if build_tests |
Petri Latvala | 0e98bf6 | 2018-06-21 14:06:25 +0300 | [diff] [blame] | 292 | subdir('tests') |
Petri Latvala | 0e98bf6 | 2018-06-21 14:06:25 +0300 | [diff] [blame] | 293 | endif |
Arkadiusz Hiler | 736b099 | 2019-05-21 12:36:01 +0300 | [diff] [blame] | 294 | build_info += 'Build tests: @0@'.format(build_tests) |
| 295 | |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 296 | subdir('benchmarks') |
| 297 | subdir('tools') |
Petri Latvala | 18c1e75 | 2018-08-08 14:07:00 +0300 | [diff] [blame] | 298 | subdir('runner') |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 299 | if libdrm_intel.found() |
| 300 | subdir('assembler') |
Petri Latvala | 0e98bf6 | 2018-06-21 14:06:25 +0300 | [diff] [blame] | 301 | endif |
| 302 | subdir('overlay') |
| 303 | subdir('man') |
| 304 | |
Arkadiusz Hiler | 736b099 | 2019-05-21 12:36:01 +0300 | [diff] [blame] | 305 | gtk_doc = dependency('gtk-doc', required : build_docs) |
Arkadiusz Hiler | d2a10fb | 2019-07-01 15:21:53 +0300 | [diff] [blame] | 306 | python3 = find_program('python3', required : build_docs) |
| 307 | if build_tests and gtk_doc.found() and python3.found() |
Arkadiusz Hiler | 736b099 | 2019-05-21 12:36:01 +0300 | [diff] [blame] | 308 | subdir('docs') |
| 309 | elif build_docs.enabled() |
| 310 | error('Documentation requires building tests') |
Daniel Vetter | 9a7d850 | 2017-09-05 14:36:14 +0200 | [diff] [blame] | 311 | endif |
Arkadiusz Hiler | 736b099 | 2019-05-21 12:36:01 +0300 | [diff] [blame] | 312 | build_info += 'Build documentation: @0@'.format(build_tests and gtk_doc.found()) |
Petri Latvala | 0e98bf6 | 2018-06-21 14:06:25 +0300 | [diff] [blame] | 313 | |
| 314 | message('Build options') |
| 315 | message('=============') |
| 316 | foreach str : build_info |
| 317 | message(str) |
| 318 | endforeach |
Maarten Lankhorst | cb8e45a | 2019-02-01 11:13:59 +0100 | [diff] [blame] | 319 | |
| 320 | if cairo.version().version_compare('<1.17.2') |
| 321 | if pixman.version().version_compare('<0.36.0') |
| 322 | warning('Pixman < 0.36.0 found, cannot test HDR formats') |
| 323 | endif |
| 324 | warning('Cairo < 1.17.2 found, cannot test HDR formats') |
| 325 | elif pixman.version().version_compare('<0.36.0') |
| 326 | # Cairo 1.17.2 requires 0.36.0 to compile, but somehow it went missing? |
| 327 | error('Cairo with floating point support found, but pixman version too old') |
| 328 | endif |