mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-12-06 18:08:31 +00:00
meson: add arguments to project
This commit is contained in:
parent
a6de4efe6e
commit
7fc4c34c2a
63
meson.build
63
meson.build
@ -1,4 +1,65 @@
|
||||
project('metamod', 'c', 'cpp')
|
||||
project('metamod', 'c', 'cpp', default_options: [
|
||||
'warning_level=1',
|
||||
'werror=true',
|
||||
'cpp_std=c++14',
|
||||
])
|
||||
|
||||
compiler = meson.get_compiler('cpp')
|
||||
if compiler.get_id() == 'clang' or compiler.get_id() == 'gcc'
|
||||
# C/C++ Defines
|
||||
add_project_arguments([
|
||||
'-Dstricmp=strcasecmp',
|
||||
'-D_stricmp=strcasecmp',
|
||||
'-D_snprintf=snprintf',
|
||||
'-D_vsnprintf=vsnprintf',
|
||||
'-DHAVE_STDINT_H',
|
||||
'-DGNUC',
|
||||
], language: ['c', 'cpp'])
|
||||
|
||||
# C/C++ Arguments
|
||||
add_project_arguments([
|
||||
'-pipe',
|
||||
'-fno-strict-aliasing',
|
||||
'-Wno-uninitialized',
|
||||
'-Wno-unused',
|
||||
'-Wno-switch',
|
||||
'-msse',
|
||||
'-fPIC',
|
||||
'-fno-omit-frame-pointer',
|
||||
], language: ['c', 'cpp'])
|
||||
|
||||
# C++ Arguments
|
||||
add_project_arguments([
|
||||
'-fno-exceptions',
|
||||
'-fno-rtti',
|
||||
'-fno-threadsafe-statics',
|
||||
'-Wno-non-virtual-dtor',
|
||||
'-Wno-overloaded-virtual',
|
||||
], language: 'cpp')
|
||||
|
||||
# Optional C++ Arguments
|
||||
optional_arguments = [
|
||||
'-Wno-delete-non-virtual-dtor',
|
||||
'-mfpmath=sse',
|
||||
'-Wno-implicit-exception-spec-mismatch',
|
||||
'-Wno-expansion-to-defined',
|
||||
'-Wno-inconsistent-missing-override',
|
||||
'-Wno-deprecated-register',
|
||||
'-Wno-deprecated',
|
||||
'-Wno-implicit-int-float-conversion',
|
||||
'-Wno-tautological-overlap-compare',
|
||||
]
|
||||
foreach arg : optional_arguments
|
||||
if compiler.has_argument(arg)
|
||||
add_project_arguments(arg, language: 'cpp')
|
||||
endif
|
||||
endforeach
|
||||
|
||||
# Platform Arguments
|
||||
add_project_arguments('-D_LINUX', language: 'cpp')
|
||||
add_project_arguments('-DPOSIX', language: 'cpp')
|
||||
add_project_arguments('-D_FILE_OFFSET_BITS=64', language: 'cpp')
|
||||
endif
|
||||
|
||||
public_inc = include_directories('public')
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user