2022-03-24 02:20:55 +01:00
|
|
|
project(
|
|
|
|
'libdisplay-info',
|
|
|
|
'c',
|
|
|
|
version: '0.0.0',
|
|
|
|
license: 'MIT',
|
2022-11-17 22:10:08 +01:00
|
|
|
meson_version: '>= 0.57.0',
|
2022-03-24 02:20:55 +01:00
|
|
|
default_options: [
|
|
|
|
'c_std=c11',
|
|
|
|
'warning_level=3',
|
|
|
|
],
|
|
|
|
)
|
2022-03-24 19:34:28 +01:00
|
|
|
|
2022-10-18 12:49:39 +02:00
|
|
|
dep_hwdata = dependency('hwdata', required: false, native: true)
|
|
|
|
if dep_hwdata.found()
|
|
|
|
hwdata_dir = dep_hwdata.get_variable(pkgconfig: 'pkgdatadir')
|
|
|
|
pnp_ids = files(hwdata_dir / 'pnp.ids')
|
|
|
|
else
|
|
|
|
pnp_ids = files('/usr/share/hwdata/pnp.ids')
|
|
|
|
endif
|
|
|
|
|
2022-11-21 15:32:31 +01:00
|
|
|
gen_search_table = find_program('script/gen-search-table.py')
|
2022-10-18 12:49:39 +02:00
|
|
|
pnp_id_table = custom_target(
|
|
|
|
'pnp-id-table.c',
|
|
|
|
command: [ gen_search_table, pnp_ids, '@OUTPUT@', 'pnp_id_table' ],
|
|
|
|
output: 'pnp-id-table.c',
|
|
|
|
)
|
|
|
|
|
2022-03-24 19:34:28 +01:00
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
2022-06-06 12:03:15 +02:00
|
|
|
math = cc.find_library('m', required: false)
|
|
|
|
|
2022-04-10 11:28:07 +02:00
|
|
|
add_project_arguments(['-D_POSIX_C_SOURCE=200809L'], language: 'c')
|
|
|
|
|
2022-03-24 19:34:28 +01:00
|
|
|
add_project_arguments(cc.get_supported_arguments([
|
|
|
|
'-Wundef',
|
|
|
|
'-Wmissing-prototypes',
|
|
|
|
'-Walloca',
|
|
|
|
'-Wdeclaration-after-statement',
|
2022-03-27 16:08:16 +02:00
|
|
|
'-Wconversion',
|
2022-03-24 19:34:28 +01:00
|
|
|
|
|
|
|
'-Wno-unused-parameter',
|
|
|
|
'-Wno-missing-field-initializers',
|
2022-06-09 15:03:48 +02:00
|
|
|
|
|
|
|
'-Werror=implicit',
|
2022-03-24 19:34:28 +01:00
|
|
|
]), language: 'c')
|
2022-03-24 13:23:07 +01:00
|
|
|
|
2022-06-06 12:23:06 +02:00
|
|
|
symbols_file = 'libdisplay-info.map'
|
|
|
|
symbols_flag = '-Wl,--version-script,@0@'.format(meson.current_source_dir() / symbols_file)
|
|
|
|
|
2022-03-24 13:23:07 +01:00
|
|
|
di_lib = library(
|
|
|
|
'display-info',
|
|
|
|
[
|
2022-06-11 11:38:49 +02:00
|
|
|
'cta.c',
|
2022-08-31 12:16:36 +02:00
|
|
|
'displayid.c',
|
2022-06-22 13:04:13 +02:00
|
|
|
'dmt-table.c',
|
2022-03-24 13:23:07 +01:00
|
|
|
'edid.c',
|
2022-09-26 11:03:57 +02:00
|
|
|
'gtf.c',
|
2022-04-10 11:07:42 +02:00
|
|
|
'info.c',
|
2022-08-02 12:18:19 +02:00
|
|
|
'log.c',
|
2022-10-18 12:49:39 +02:00
|
|
|
pnp_id_table,
|
2022-03-24 13:23:07 +01:00
|
|
|
],
|
|
|
|
include_directories: include_directories('include'),
|
2022-08-03 10:37:07 +02:00
|
|
|
dependencies: [math],
|
2022-06-06 12:23:06 +02:00
|
|
|
link_args: symbols_flag,
|
|
|
|
link_depends: symbols_file,
|
2022-03-24 13:23:07 +01:00
|
|
|
install: true,
|
|
|
|
)
|
|
|
|
|
|
|
|
install_subdir(
|
|
|
|
'include/libdisplay-info',
|
|
|
|
install_dir: get_option('includedir'),
|
|
|
|
)
|
|
|
|
|
|
|
|
pkgconfig = import('pkgconfig')
|
|
|
|
pkgconfig.generate(
|
|
|
|
di_lib,
|
|
|
|
description: 'EDID and DisplayID library',
|
|
|
|
)
|
2022-03-24 17:20:13 +01:00
|
|
|
|
|
|
|
di_dep = declare_dependency(
|
|
|
|
link_with: di_lib,
|
|
|
|
include_directories: include_directories('include'),
|
|
|
|
)
|
|
|
|
|
2022-11-19 22:44:18 +01:00
|
|
|
meson.override_dependency('libdisplay-info', di_dep)
|
|
|
|
|
2022-11-21 15:29:53 +01:00
|
|
|
subdir('di-edid-decode')
|
2022-03-28 11:17:07 +02:00
|
|
|
subdir('test')
|