Commit 1db12466 authored by Daniel Vetter's avatar Daniel Vetter

meson: build a full dependency for lib_igt_perf

meson prefers packages dependencies over passing arount static
libraries, because those also include linker flags, include dirs and
everything else.

While at it pull the special cases out from the common build stanzas
like we do with other special cases.

Just a bit of ocd to keep everything polished.

v2: Don't forget to add perf_pmu to the test list (Petri).

Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Petri Latvala's avatarPetri Latvala <petri.latvala@intel.com>
Signed-off-by: Daniel Vetter's avatarDaniel Vetter <daniel.vetter@intel.com>
parent 491e8c17
......@@ -12,7 +12,6 @@ benchmark_progs = [
'gem_prw',
'gem_set_domain',
'gem_syslatency',
'gem_wsim',
'kms_vblank',
'prime_lookup',
'vgem_mmap',
......@@ -31,11 +30,9 @@ endif
foreach prog : benchmark_progs
# FIXME meson doesn't like binaries with the same name
# meanwhile just suffix with _bench
link = []
if prog == 'gem_wsim'
link += lib_igt_perf
endif
executable(prog + '_bench', prog + '.c',
link_with : link,
dependencies : test_deps)
endforeach
executable('gem_wsim_bench', 'gem_wsim.c',
dependencies : test_deps + [ lib_igt_perf ])
......@@ -180,8 +180,11 @@ lib_igt = declare_dependency(link_with : lib_igt_build,
igt_deps = [ lib_igt ] + lib_deps
lib_igt_perf = static_library('igt_perf',
lib_igt_perf_build = static_library('igt_perf',
['igt_perf.c']
)
lib_igt_perf = declare_dependency(link_with : lib_igt_perf_build,
include_directories : inc)
subdir('tests')
......@@ -21,7 +21,8 @@ dri2proto = dependency('dri2proto', version : '>= 2.6', required : false)
cairo_xlib = dependency('cairo-xlib', required : false)
xrandr = dependency('xrandr', version : '>=1.3', required : false)
gpu_overlay_deps = [ realtime, math, cairo, pciaccess, libdrm, libdrm_intel ]
gpu_overlay_deps = [ realtime, math, cairo, pciaccess, libdrm,
libdrm_intel, lib_igt_perf ]
both_x11_src = ''
......@@ -55,6 +56,5 @@ if xrandr.found() and cairo.found()
include_directories : inc,
c_args : gpu_overlay_cflags,
dependencies : gpu_overlay_deps,
link_with : lib_igt_perf,
install : true)
endif
......@@ -191,7 +191,6 @@ test_progs = [
'kms_vblank',
'meta_test',
'perf',
'perf_pmu',
'pm_backlight',
'pm_lpsp',
'pm_rc6_residency',
......@@ -261,17 +260,18 @@ libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'), 'intel-g
test_executables = []
foreach prog : test_progs
link = []
if prog == 'perf_pmu'
link += lib_igt_perf
endif
test_executables += executable(prog, prog + '.c',
dependencies : test_deps,
install_dir : libexecdir,
link_with : link,
install : true)
endforeach
test_executables += executable('perf_pmu', 'perf_pmu.c',
dependencies : test_deps + [ lib_igt_perf ],
install_dir : libexecdir,
install : true)
test_progs += 'perf_pmu'
executable('testdisplay', ['testdisplay.c', 'testdisplay_hotplug.c'],
dependencies : test_deps,
install_dir : libexecdir,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment