Skip to content

Commit 98b3de2

Browse files
committed
Use project arguments for HAVE_X11 and HAVE_WAYLAND
This means you don't have to use explicit compiler_args for cpp.preprocess which then means the meson requirement can be lowered. Signed-off-by: Alfred Wingate <parona@protonmail.com>
1 parent 49c837d commit 98b3de2

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ project('MangoHud',
22
['c', 'cpp'],
33
version : 'v0.8.1',
44
license : 'MIT',
5-
meson_version: '>=1.3.2',
5+
meson_version: '>=0.64.0',
66
default_options : ['buildtype=release', 'c_std=c99', 'cpp_std=c++17', 'warning_level=2']
77
)
88

src/meson.build

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ if is_unixy
146146
endif
147147

148148
if get_option('with_x11').enabled()
149-
pre_args += '-DHAVE_X11'
149+
add_project_arguments('-DHAVE_X11', language : ['c', 'cpp'])
150150

151151
vklayer_files += files(
152152
'loaders/loader_x11.cpp',
@@ -160,7 +160,7 @@ if is_unixy
160160
endif
161161

162162
if get_option('with_wayland').enabled()
163-
pre_args += '-DHAVE_WAYLAND'
163+
add_project_arguments('-DHAVE_WAYLAND', language : ['c', 'cpp'])
164164

165165
vklayer_files += files(
166166
'wayland_keybinds.cpp'
@@ -240,10 +240,7 @@ mangohud_shared_lib = shared_library(
240240
)
241241

242242
if is_unixy
243-
mangohud_opengl_versionscript = cpp.preprocess(
244-
'mangohud_opengl.version',
245-
compile_args: pre_args,
246-
)
243+
mangohud_opengl_versionscript = cpp.preprocess('mangohud_opengl.version')
247244

248245
mangohud_opengl_shared_lib = shared_library(
249246
'MangoHud_opengl',

0 commit comments

Comments
 (0)