-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmeson.build
More file actions
152 lines (126 loc) · 3.91 KB
/
meson.build
File metadata and controls
152 lines (126 loc) · 3.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# Copyright (C) 2024-2026 Intel Corporation
# SPDX-License-Identifier: MIT
project('vsyncalter', 'cpp',
version: '4.0.0',
license: 'MIT',
default_options: [
'cpp_std=c++11',
'warning_level=2',
'buildtype=release',
],
meson_version: '>=0.56.0'
)
# Project information
project_description = 'VSync Alteration Library and Tools'
# Get version components
version_array = meson.project_version().split('.')
version_major = version_array[0]
version_minor = version_array[1]
version_patch = version_array[2]
# Platform detection
host_system = host_machine.system()
if host_system == 'linux'
platform = 'linux'
message('Detected platform: Linux')
else
error('Unsupported platform: ' + host_system)
endif
# Build options
build_shared = get_option('build_shared_libs')
build_swgenlock = get_option('build_swgenlock')
build_pllctl = get_option('build_pllctl')
build_vblmon = get_option('build_vblmon')
build_framesync = get_option('build_framesync')
enable_coverage = get_option('enable_coverage')
# Compiler
cpp_compiler = meson.get_compiler('cpp')
# Global include directories
inc_dirs = include_directories('cmn', 'os', 'lib')
# App include dirs - only need cmn and os, no lib dependency
app_inc_dirs = include_directories('cmn', 'os')
# Platform-specific dependencies and settings
platform_deps = []
platform_link_args = []
platform_compile_args = []
if platform == 'linux'
# Linux-specific includes
drm_inc = include_directories('/usr/include/drm', is_system: true)
# Find required libraries
rt_dep = cpp_compiler.find_library('rt', required: true)
drm_dep = dependency('libdrm', required: true)
pciaccess_dep = dependency('pciaccess', required: true)
threads_dep = dependency('threads', required: true)
platform_deps = [rt_dep, drm_dep, pciaccess_dep, threads_dep]
message('Linux libraries found:')
message(' - rt: @0@'.format(rt_dep.found()))
message(' - drm: @0@'.format(drm_dep.found()))
message(' - pciaccess: @0@'.format(pciaccess_dep.found()))
message(' - threads: @0@'.format(threads_dep.found()))
endif
# Common compile arguments
common_compile_args = ['-Wall']
if get_option('buildtype') == 'debug'
common_compile_args += ['-g', '-O0', '-DDEBUGGON']
endif
# Subdirectories
subdir('lib')
if build_pllctl
subdir('pllctl')
endif
if build_vblmon
subdir('vblmon')
endif
if build_swgenlock
subdir('swgenlock')
endif
if build_framesync
subdir('framesync')
endif
# Installation of headers
install_subdir('cmn',
install_dir: get_option('includedir') / 'vsyncalter',
strip_directory: true,
exclude_files: ['*.cpp', '*.o']
)
install_subdir('os',
install_dir: get_option('includedir') / 'vsyncalter' / 'os',
strip_directory: false,
exclude_files: ['*.cpp', '*.o']
)
# pkg-config file generation
pkg = import('pkgconfig')
pkg.generate(
vsyncalter_shared,
name: 'vsyncalter',
description: project_description,
version: meson.project_version(),
filebase: 'vsyncalter',
subdirs: ['vsyncalter'],
)
# Print build configuration summary
summary_info = {
'Version': meson.project_version(),
'Platform': platform,
'Build type': get_option('buildtype'),
'C++ standard': get_option('cpp_std'),
'Warning level': get_option('warning_level'),
'Build framesync': build_framesync,
'Shared libraries': build_shared,
'Build pllctl': build_pllctl,
'Build vblmon': build_vblmon,
'Build swgenlock': build_swgenlock,
'Coverage enabled': enable_coverage,
'Install prefix': get_option('prefix'),
'Include directory': get_option('includedir'),
'Library directory': get_option('libdir'),
'Binary directory': get_option('bindir'),
}
message('')
message('==================================================')
message('VSync Alteration Build Configuration Summary')
message('==================================================')
foreach key, value : summary_info
message(' @0@: @1@'.format(key, value))
endforeach
message('==================================================')
message('')