Files
fadec/meson.build
Alexis Engelke a3f77dbf49 Initial commit
2018-04-08 13:45:13 +00:00

53 lines
2.0 KiB
Meson

project('libx86decode', ['c'], default_options: ['warning_level=3', 'c_std=c99'])
python3 = find_program('python3')
if get_option('warning_level').to_int() >= 3
add_project_arguments(['-Wmissing-field-initializers',
'-Wunused-parameter',
'-Wold-style-definition',
'-Wmissing-declarations',
'-Wmissing-prototypes',
'-Wmissing-noreturn',
'-Wshadow',
'-Wpointer-arith',
'-Wcast-align',
'-Wwrite-strings',
'-Winline',
'-Wformat-nonliteral',
'-Wformat-security',
'-Wswitch-default',
'-Winit-self',
'-Wnested-externs',
'-Wstrict-prototypes',
'-Wmissing-include-dirs',
'-Wundef',
'-Waggregate-return',
'-Wredundant-decls',
'-Wno-overlength-strings',
'-Wmissing-format-attribute'],
language: 'c')
endif
c_compiler = meson.get_compiler('c')
pointer_size = c_compiler.sizeof('void*')
if pointer_size == 4
add_project_arguments(['-DARCH_386'], language: 'c')
elif pointer_size == 8
add_project_arguments(['-DARCH_X86_64'], language: 'c')
else
error('Invalid pointer size')
endif
instr_data = custom_target('tables',
command: [python3, '@INPUT0@', '@INPUT1@', '@OUTPUT@'],
input: files('parseinstrs.py', 'instrs.txt'),
output: ['decode-table.inc'])
libdecode = static_library('x86decode', 'decode.c', 'format.c', instr_data)
libx86decode = declare_dependency(link_with: libdecode,
include_directories: include_directories('.'),
sources: instr_data)
subdir('tests')