1lib_brw_src = [ 2 'brw_context.c', 3 'brw_disasm.c', 4 'brw_eu.c', 5 'brw_eu_compact.c', 6 'brw_eu_debug.c', 7 'brw_eu_emit.c', 8 'brw_eu_util.c', 9 'gen8_disasm.c', 10 'gen8_instruction.c', 11 'ralloc.c', 12] 13 14assembler_warnflags = [ 15 '-Wno-declaration-after-statement', 16 '-Wno-discarded-qualifiers', 17 '-Wno-missing-format-attribute', 18 '-Wno-old-style-definition', 19 '-Wno-redundant-decls', 20 '-Wno-shadow', 21] 22assembler_args = [] 23foreach flag : assembler_warnflags 24 if cc.has_argument(flag) 25 assembler_args += flag 26 endif 27endforeach 28 29lib_brw = static_library('brw', lib_brw_src, 30 c_args : assembler_args, 31 dependencies : igt_deps) 32 33flex = find_program('flex') 34bison = find_program('bison') 35 36lgen = generator(flex, 37 output : '@BASENAME@.c', 38 arguments : ['-i', '-o', '@OUTPUT@', '@INPUT@']) 39 40lfiles = lgen.process('lex.l') 41 42pgen = generator(bison, 43 output : ['@BASENAME@.c', '@BASENAME@.h'], 44 arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@']) 45 46pfiles = pgen.process('gram.y') 47 48executable('intel-gen4asm', 'main.c', lfiles, pfiles, 49 c_args : assembler_args, 50 link_with : lib_brw, install : true) 51 52executable('intel-gen4disasm', 'disasm-main.c', 53 c_args : assembler_args, 54 link_with : lib_brw, install : true) 55 56conf_data = configuration_data() 57conf_data.set('prefix', prefix) 58conf_data.set('exec_prefix', '${prefix}') 59conf_data.set('libdir', join_paths('${prefix}', libdir)) 60conf_data.set('includedir', join_paths('${prefix}', includedir)) 61conf_data.set('VERSION', meson.project_version()) 62configure_file(input : 'intel-gen4asm.pc.in', output : 'intel-gen4asm.pc', 63 configuration : conf_data, install_dir : pkgconfigdir) 64 65gen4asm_testcases = [ 66 'test/mov', 67 'test/frc', 68 'test/regtype', 69 'test/rndd', 70 'test/rndu', 71 'test/rnde', 72 'test/rnde-intsrc', 73 'test/rndz', 74 'test/lzd', 75 'test/not', 76 'test/immediate', 77] 78 79# Those tests were already failing when the assembler was imported from 80# the intel-gen4asm git repository: 81# http://cgit.freedesktop.org/xorg/app/intel-gen4asm/ 82# We disable them "for now" as a workaround to be able to release i-g-t 83gen4asm_testcases_broken = [ 84 'test/declare', 85 'test/jmpi', 86 'test/if', 87 'test/iff', 88 'test/while', 89 'test/else', 90 'test/break', 91 'test/cont', 92 'test/halt', 93 'test/wait', 94 'test/endif', 95] 96 97test_runner = find_program('test/run-test.sh') 98foreach testcase : gen4asm_testcases 99 test('assembler: ' + testcase, test_runner, 100 args : testcase, 101 env : [ 'srcdir=' + meson.current_source_dir(), 102 'top_builddir=' + meson.current_build_dir()]) 103endforeach 104