Skip to content

Instantly share code, notes, and snippets.

@mgood7123
Last active December 4, 2022 16:20
Show Gist options
  • Save mgood7123/d4774448f65585237582e795fa45de16 to your computer and use it in GitHub Desktop.
Save mgood7123/d4774448f65585237582e795fa45de16 to your computer and use it in GitHub Desktop.
project(
'wayland_syscall', 'cpp',
version: '1',
license: 'MIT',
meson_version: '>= 0.56.0',
default_options: [
'warning_level=2',
'buildtype=debugoptimized'
]
)
ccpp = meson.get_compiler('cpp')
cc_args = []
if ccpp.get_id() == 'clang-cl'
# enable color output for clang-cl
cc_args += ['-Xclang', '-fcolor-diagnostics']
cc_args += ['-Xclang', '-fansi-escape-codes']
cc_args += ['-Xclang', '-std=c++17']
# also specify -fvisibility=hidden for clang
cc_args += ['-Xclang', '-fvisibility', '-Xclang', 'hidden']
# enable color output for lld-link
add_project_link_arguments(['--color-diagnostics'], language: 'cpp')
endif
add_project_arguments(cc_args, language: 'cpp')
compiler_flags = [
'-Wno-unused-parameter',
'-Wstrict-prototypes',
'-Wmissing-prototypes',
'-fvisibility=hidden',
'-fdiagnostics-color=always',
'-fcolor-diagnostics',
]
add_project_arguments(
ccpp.get_supported_arguments(compiler_flags),
language: 'cpp'
)
root_inc = include_directories('.')
wayland_syscall_prog = executable(
'wayland-syscall-gen',
[
'Iterator.cpp',
'IteratorMatcher.cpp',
'Input.cpp',
'Error.cpp',
'Rules.cpp',
'Conditional.cpp',
'Stack.cpp',
'main.cpp'
],
include_directories: root_inc
)
custom_target('final binary',
depends : wayland_syscall_prog,
command : wayland_syscall_prog,
input : wayland_syscall_prog,
build_always_stale : true,
build_by_default : true,
output : 'fake',
console : true
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment