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 /lib/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 'lib/meson.build')
-rw-r--r-- | lib/meson.build | 166 |
1 files changed, 166 insertions, 0 deletions
diff --git a/lib/meson.build b/lib/meson.build new file mode 100644 index 00000000..51d3f9e2 --- /dev/null +++ b/lib/meson.build @@ -0,0 +1,166 @@ +lib_headers = [ + 'debug.h', + 'drmtest.h', + 'i830_reg.h', + 'i915_3d.h', + 'i915_reg.h', + 'i915_pciids.h', + 'igt.h', + 'igt_debugfs.h', + 'igt_aux.h', + 'igt_edid_template.h', + 'igt_gt.h', + 'igt_gvt.h', + 'igt_primes.h', + 'igt_rand.h', + 'igt_stats.h', + 'igt_sysfs.h', + 'igt_x86.h', + 'igt_vgem.h', + 'instdone.h', + 'intel_batchbuffer.h', + 'intel_chipset.h', + 'intel_io.h', + 'intel_reg.h', + 'ioctl_wrappers.h', + 'media_fill.h', + 'media_spin.h', + 'gpgpu_fill.h', + 'gen7_media.h', + 'gen8_media.h', + 'gen6_render.h', + 'gen7_render.h', + 'gen8_render.h', + 'gen9_render.h', + 'rendercopy.h', + 'sw_sync.h', + 'igt_kms.h', + 'igt_fb.h', + 'igt_core.h', + 'igt_draw.h', + 'igt_pm.h', + 'igt_dummyload.h', + 'uwildmat/uwildmat.h', + 'igt_kmod.h', +] + +lib_sources = [ + 'drmtest.c', + 'igt_debugfs.c', + 'igt_aux.c', + 'igt_gt.c', + 'igt_gvt.c', + 'igt_primes.c', + 'igt_rand.c', + 'igt_stats.c', + 'igt_sysfs.c', + 'igt_x86.c', + 'igt_vgem.c', + 'instdone.c', + 'intel_batchbuffer.c', + 'intel_chipset.c', + 'intel_device_info.c', + 'intel_os.c', + 'intel_mmio.c', + 'ioctl_wrappers.c', + 'media_fill_gen7.c', + 'media_fill_gen8.c', + 'media_fill_gen8lp.c', + 'media_fill_gen9.c', + 'media_spin.c', + 'gpgpu_fill.c', + 'rendercopy_i915.c', + 'rendercopy_i830.c', + 'rendercopy_gen6.c', + 'rendercopy_gen7.c', + 'rendercopy_gen8.c', + 'rendercopy_gen9.c', + 'sw_sync.c', + 'intel_reg_map.c', + 'intel_iosf.c', + 'igt_kms.c', + 'igt_fb.c', + 'igt_core.c', + 'igt_draw.c', + 'igt_pm.c', + 'igt_dummyload.c', + 'uwildmat/uwildmat.c', + 'igt_kmod.c', +] + +lib_deps = [ + cairo, + glib, + libdrm, + libkmod, + libprocps, + libudev, + libunwind, + pciaccess, + pthreads, + math, + realtime, +] + +if libdrm_intel.found() + lib_deps += libdrm_intel +else + lib_headers += 'stubs/drm/intel_bufmgr.h' + lib_sources += 'stubs/drm/intel_bufmgr.c' +endif + +if libdrm_vc4.found() + lib_headers += 'igt_vc4.h' + lib_sources += 'igt_vc4.c' +endif +if valgrind.found() + lib_deps += valgrind +endif + +if gsl.found() + lib_deps += gsl + lib_headers += [ 'igt_frame.h', 'igt_audio.h' ] + lib_sources += [ 'igt_frame.c', 'igt_audio.c' ] +endif + +if alsa.found() + lib_deps += alsa + lib_headers += 'igt_alsa.h' + lib_sources += 'igt_alsa.c' +endif + +if chamelium.found() + lib_deps += chamelium + lib_headers += 'igt_chamelium.h' + lib_sources += 'igt_chamelium.c' +endif + +install_headers(lib_headers) + +pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), 'intel-gpu-tools') +srcdir = join_paths(meson.source_root(), 'tests') + +vcs_tag(input : 'version.h.in', output : 'version.h', + fallback : 'NO-GIT', + command : [ 'git', 'log', '-n1', '--pretty=format:g%h' ] ) + +# FIXME we don't regenerate when the script changes +prepend_log_domain = generator(find_program('prepend_log_domain.sh'), + arguments : [ '@INPUT@', '@OUTPUT@' ], + output : '@PLAINNAME@' + '.pre.c') + +processed_src_dep = prepend_log_domain.process(lib_sources) + +lib_igt_build = shared_library('igt', + processed_src_dep, + include_directories : inc, + dependencies : lib_deps, + c_args : [ '-DIGT_DATADIR="@0@"'.format(pkgdatadir), + '-DIGT_SRCDIR="@0@"'.format(srcdir), ]) + +lib_igt = declare_dependency(link_with : lib_igt_build, + include_directories : inc) + +igt_deps = [ lib_igt ] + lib_deps + +subdir('tests') |