diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-09-05 14:36:14 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-09-08 17:06:04 +0200 |
commit | 9a7d8509efe4ac509b082cbffa24e52a7697926c (patch) | |
tree | ee097782344880b41f23c0a1571fc28ae6e4e0ce /meson.build | |
parent | c3863e1998a5d46492b4ec91dd411e2d561e1472 (diff) |
meson: basic build system support
Why?
Because it's fast.
Like really, really fast.
Some data (from a snb laptop, so rather lower-powered):
- Incremental build after $ touch lib/igt_core.c with meson: 0.6s
It notices that the symbol list of the libigt.so hasn't changed and
doesn't bother re-linking the almost 300 binaries we have. make -j 6
for the same scenario takes 44s.
- Incremental build with nothing changed: make: 0.7s, meson: 0.2s This
means stuff like --disable-git-hash is entirely pointless with
meson, it's faster than a make ever can be (with 0.6s).
- Reconfigure stage: ninja reconfigure 0.8s vs. ./configure 8.6s)
- Running tests, after a full build: ninja test 6s vs. make check 24s
- Full build (i.e. including ./autogen.sh respectively meson build),
including tests, from a pristine git checkout. automake 2m49s vs.
meson 44s.
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Daniel Stone <daniel@fooishbar.org>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/meson.build b/meson.build new file mode 100644 index 00000000..fee64fcd --- /dev/null +++ b/meson.build @@ -0,0 +1,105 @@ +project('IGT gpu tests', 'c', + version : '1.19', + default_options: [ + 'warning_level=2', + 'c_std=gnu99', + ], + license : 'MIT') + +cc = meson.get_compiler('c') + +inc = include_directories('lib', '.') + +config_h = configuration_data() + +libdrm = dependency('libdrm', version : '>=2.4.82') +libdrm_intel = dependency('libdrm_intel', required : false) +libdrm_vc4 = dependency('libdrm_vc4', required : false) +libdrm_nouveau = dependency('libdrm_nouveau', required : false) +libdrm_amdgpu = dependency('libdrm_amdgpu', required : false) + +pciaccess = dependency('pciaccess', version : '>=0.10') +libkmod = dependency('libkmod') +libprocps = dependency('libprocps', required : false) +if libprocps.found() + config_h.set('HAVE_PROCPS', 1) +endif + +valgrind = dependency('valgrind', required : false) +if valgrind.found() + config_h.set('HAVE_VALGRIND', 1) +endif + +cairo = dependency('cairo', version : '>1.12.0', required : false) + +libudev = dependency('libudev', required : false) +if libudev.found() + config_h.set('HAVE_UDEV', 1) +endif + +glib = dependency('glib-2.0', required : false) +if glib.found() + config_h.set('HAVE_GLIB', 1) +endif + +libunwind = dependency('libunwind') +gsl = dependency('gsl', required : false) +alsa = dependency('alsa', required : false) + +pixman = dependency('pixman-1', required : false) +xmlrpc = dependency('xmlrpc', required : false) +xmlrpc_util = dependency('xmlrpc_util', required : false) +xmlrpc_client = dependency('xmlrpc_client', required : false) + +if pixman.found() and xmlrpc.found() and xmlrpc_util.found() and xmlrpc_client.found() + chamelium = declare_dependency(dependencies : [ pixman, xmlrpc, + xmlrpc_util, xmlrpc_client]) +else + chamelium = dependency('', required: false) +endif + +pthreads = dependency('threads') +math = cc.find_library('m') +realtime = cc.find_library('rt') +dlsym = cc.find_library('dl') +zlib = cc.find_library('z') + +if cc.has_header('linux/kd.h') + config_h.set('HAVE_LINUX_KD_H', 1) +endif +if cc.has_header('sys/kd.h') + config_h.set('HAVE_SYS_KD_H', 1) +endif +if cc.has_header('libgen.h') + config_h.set('HAVE_LIBGEN_H', 1) +endif +if cc.has_header('sys/io.h') + config_h.set('HAVE_SYS_IO_H', 1) +endif +if cc.has_header('cpuid.h') + # FIXME: Do we need the example link test from configure.ac? + config_h.set('HAVE_CPUID_H', 1) +endif + +if cc.has_member('struct sysinfo', 'totalram', + prefix : '#include <sys/sysinfo.h>') + config_h.set('HAVE_STRUCT_SYSINFO_TOTALRAM', 1) +endif + +add_project_arguments('-D_GNU_SOURCE', language : 'c') +add_project_arguments('-include', 'config.h', language : 'c') + +config_h.set_quoted('PACKAGE_VERSION', meson.project_version()) +config_h.set_quoted('PACKAGE', meson.project_name()) +config_h.set_quoted('TARGET_CPU_PLATFORM', host_machine.cpu_family()) + +configure_file(output: 'config.h', install: false, configuration: config_h) + +subdir('lib') +subdir('tests') +subdir('benchmarks') +subdir('tools') +if libdrm_intel.found() + subdir('assembler') + subdir('overlay') +endif |