diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2017-10-22 18:40:24 +0300 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-02-06 13:12:33 +0000 |
commit | 781fd07e5518b21b5d910e0c58108a517903fda3 (patch) | |
tree | 74d3f45ddbbbba880cd6a5397de505a4a13d8c76 /src/sna | |
parent | a3a9e99b527936502a10aed7559799b2aa1e186e (diff) |
meson: Add meson build system
Allow building the driver with meson. Could probably use
plenty of cleanups, but at least it gives me a working driver.
And I think I managed to make it build everything that
autotools builds.
Quite a few compiler warnings were suppressed as well. Might
want to look at those at some point.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/brw/meson.build | 41 | ||||
-rw-r--r-- | src/sna/fb/meson.build | 31 | ||||
-rw-r--r-- | src/sna/git_version.h.in | 1 | ||||
-rw-r--r-- | src/sna/meson.build | 139 |
4 files changed, 212 insertions, 0 deletions
diff --git a/src/sna/brw/meson.build b/src/sna/brw/meson.build new file mode 100644 index 00000000..fcf2b120 --- /dev/null +++ b/src/sna/brw/meson.build @@ -0,0 +1,41 @@ +brw_deps = [ + xorg, + libudev, + libdrm, +] + +if with_valgrind + brw_deps += valgrind +endif + +brw = static_library('brw', + sources : [ + 'brw_disasm.c', + 'brw_eu.c', + 'brw_eu_emit.c', + 'brw_sf.c', + 'brw_wm.c', + ], + dependencies : brw_deps, + include_directories : inc, + c_args : [ + '-Wno-unused-parameter', + '-Wno-sign-compare', + ], + install : false) + +executable('brw_test', + sources : [ + 'brw_test.c', + 'brw_test_gen4.c', + 'brw_test_gen5.c', + 'brw_test_gen6.c', + 'brw_test_gen7.c', + ], + link_with : brw, + include_directories : inc, + c_args : [ + '-Wno-unused-const-variable', + '-Wno-unused-parameter', + ], + install : false) diff --git a/src/sna/fb/meson.build b/src/sna/fb/meson.build new file mode 100644 index 00000000..3a09ba22 --- /dev/null +++ b/src/sna/fb/meson.build @@ -0,0 +1,31 @@ +fb = static_library('fb', + sources : [ + 'fbarc.c', + 'fbbitmap.c', + 'fbblt.c', + 'fbbltone.c', + 'fbclip.c', + 'fbcopy.c', + 'fbfill.c', + 'fbgc.c', + 'fbglyph.c', + 'fbimage.c', + 'fbline.c', + 'fbpict.c', + 'fbpoint.c', + 'fbpush.c', + 'fbseg.c', + 'fbspan.c', + 'fbstipple.c', + 'fbtile.c', + 'fbutil.c', + ], + dependencies : [ + xorg, + pixman, + ], + c_args : [ + '-Wno-unused-parameter', + '-Wno-sign-compare', + ], + install : false) diff --git a/src/sna/git_version.h.in b/src/sna/git_version.h.in new file mode 100644 index 00000000..dd8e5170 --- /dev/null +++ b/src/sna/git_version.h.in @@ -0,0 +1 @@ +static const char git_version[] = "@VCS_TAG@"; diff --git a/src/sna/meson.build b/src/sna/meson.build new file mode 100644 index 00000000..5631d4d8 --- /dev/null +++ b/src/sna/meson.build @@ -0,0 +1,139 @@ +config.set('USE_SNA', 1) + +if cc.has_member('struct sysinfo', 'totalram', + prefix : '#include <sys/sysinfo.h>') + config.set('HAVE_STRUCT_SYSINFO_TOTALRAM', 1) +endif + +git_version_h = vcs_tag(input : 'git_version.h.in', output : 'git_version.h', + fallback : 'not compiled from git', + command : [ 'git', 'describe' ] ) + +config.set('HAVE_DOT_GIT', 1) + +if cc.has_header('alloca.h') + config.set('HAVE_ALLOCA_H', 1) +endif + +sna_deps = [ + cc.find_library('m', required : true), + dependency('threads', required : true), + dependency('xorg-server', required : true), + dependency('libdrm', required : true), +] + +sna_sources = [ + 'blt.c', + 'kgem.c', + 'sna_accel.c', + 'sna_acpi.c', + 'sna_blt.c', + 'sna_composite.c', + 'sna_cpu.c', + 'sna_damage.c', + 'sna_display.c', + 'sna_display_fake.c', + 'sna_driver.c', + 'sna_glyphs.c', + 'sna_gradient.c', + 'sna_io.c', + 'sna_render.c', + 'sna_stream.c', + 'sna_trapezoids.c', + 'sna_trapezoids_boxes.c', + 'sna_trapezoids_imprecise.c', + 'sna_trapezoids_mono.c', + 'sna_trapezoids_precise.c', + 'sna_tiling.c', + 'sna_transform.c', + 'sna_threads.c', + 'sna_vertex.c', + 'sna_video.c', + 'sna_video_overlay.c', + 'sna_video_sprite.c', + 'sna_video_textured.c', + 'gen2_render.c', + 'gen3_render.c', + 'gen4_common.c', + 'gen4_render.c', + 'gen4_source.c', + 'gen4_vertex.c', + 'gen5_render.c', + 'gen6_common.c', + 'gen6_render.c', + 'gen7_render.c', + 'gen8_eu.c', + 'gen8_render.c', + 'gen8_vertex.c', + 'gen9_render.c', +] + +if libudev.found() + sna_deps += libudev +endif + +if with_valgrind + sna_deps += valgrind +endif + +if with_dri2 + sna_sources += 'sna_dri2.c' + sna_deps += [ + dependency('dri2proto', required : true), + cc.find_library('rt', required : true), + ] +endif + +if with_dri3 + sna_sources += 'sna_dri3.c' + sna_deps += dri3 +endif + +if has_present + sna_sources += 'sna_present.c' + sna_deps += present +endif + +if with_xvmc + sna_sources += 'sna_video_hwmc.c' +endif + +if debug == 'full' + sna_sources += [ + 'kgem_debug.c', + 'kgem_debug_gen2.c', + 'kgem_debug_gen3.c', + 'kgem_debug_gen4.c', + 'kgem_debug_gen5.c', + 'kgem_debug_gen6.c', + 'kgem_debug_gen7.c', + ] +endif + +if get_option('tearfree') + config.set('TEARFREE', 1) +endif +if get_option('use-create2') + config.set('USE_CREATE2', 1) +endif +if get_option('async-swap') + config.set('USE_ASYNC_SWAP', 1) +endif + +subdir('brw') +subdir('fb') + +sna = static_library('sna', + [ git_version_h, sna_sources ], + dependencies : sna_deps, + link_with : [ brw, fb, ], + include_directories : inc, + c_args : [ + '-Wno-missing-field-initializers', + '-Wno-unused-but-set-variable', + '-Wno-shift-negative-value', + '-Wno-unused-parameter', + '-Wno-sign-compare', + '-Wno-type-limits', + ], + install : false) |