mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-12-06 18:08:31 +00:00
Compare commits
7 Commits
b125693fbe
...
fbb115ec02
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbb115ec02 | ||
|
|
3f3136d483 | ||
|
|
168f4c265b | ||
|
|
41fe2a5826 | ||
|
|
8951660b57 | ||
|
|
7fc4c34c2a | ||
|
|
a6de4efe6e |
87
core/meson.build
Normal file
87
core/meson.build
Normal file
@ -0,0 +1,87 @@
|
||||
core_src = [
|
||||
'metamod.cpp',
|
||||
'metamod_console.cpp',
|
||||
'metamod_oslink.cpp',
|
||||
'metamod_plugins.cpp',
|
||||
'metamod_util.cpp',
|
||||
'provider/provider_base.cpp',
|
||||
'sourcehook/sourcehook.cpp',
|
||||
'sourcehook/sourcehook_impl_chookidman.cpp',
|
||||
'sourcehook/sourcehook_impl_chookmaninfo.cpp',
|
||||
'sourcehook/sourcehook_impl_cproto.cpp',
|
||||
'sourcehook/sourcehook_impl_cvfnptr.cpp',
|
||||
'sourcehook/sourcehook_hookmangen.cpp',
|
||||
'gamedll_bridge.cpp',
|
||||
]
|
||||
|
||||
foreach sdk : get_option('sdks')
|
||||
sdk_dep = dependency(sdk)
|
||||
|
||||
if sdk_dep.get_variable('engine') == 'source2'
|
||||
sdk_src = [
|
||||
'provider/source2/provider_source2.cpp',
|
||||
]
|
||||
sdk_cpp_args = [
|
||||
'-DMETA_IS_SOURCE2',
|
||||
]
|
||||
else
|
||||
sdk_src = [
|
||||
'provider/source/provider_source.cpp',
|
||||
'provider/source/provider_source_console.cpp',
|
||||
'vsp_bridge.cpp',
|
||||
]
|
||||
endif
|
||||
|
||||
sdk_link_args = []
|
||||
if target_machine.system() == 'linux'
|
||||
if compiler.get_id() == 'gcc'
|
||||
sdk_link_args += [
|
||||
'-static-libgcc',
|
||||
]
|
||||
elif compiler.get_id() == 'clang'
|
||||
sdk_link_args += [
|
||||
'-lgcc_eh',
|
||||
]
|
||||
endif
|
||||
sdk_link_args += [
|
||||
'-static-libstdc++',
|
||||
]
|
||||
elif target_machine.system() == 'mac'
|
||||
sdk_link_args += ['-liconv']
|
||||
endif
|
||||
|
||||
if target_machine.cpu_family() == 'x86_64' and target_machine.system() != 'linux'
|
||||
sdk_src += ['sourcehook/sourcehook_hookmangen_x86_64.cpp']
|
||||
elif target_machine.cpu_family() == 'x86'
|
||||
sdk_src += ['sourcehook/sourcehook_hookmangen_x86.cpp']
|
||||
endif
|
||||
|
||||
build_target('metamod.' + sdk_dep.get_variable('suffix'),
|
||||
name_prefix: '',
|
||||
target_type: 'shared_library',
|
||||
override_options: 'b_lundef=false',
|
||||
sources: [
|
||||
core_src,
|
||||
sdk_src,
|
||||
],
|
||||
include_directories: [
|
||||
core_inc,
|
||||
loader_inc,
|
||||
sourcehook_inc,
|
||||
amtl_inc,
|
||||
public_inc,
|
||||
],
|
||||
cpp_args: [
|
||||
sdk_cpp_args
|
||||
],
|
||||
link_args: [
|
||||
sdk_link_args,
|
||||
],
|
||||
dependencies: [
|
||||
sdk_dep,
|
||||
],
|
||||
link_with: [
|
||||
versionlib,
|
||||
]
|
||||
)
|
||||
endforeach
|
||||
60
loader/meson.build
Normal file
60
loader/meson.build
Normal file
@ -0,0 +1,60 @@
|
||||
loader_src = [
|
||||
'loader.cpp',
|
||||
'gamedll.cpp',
|
||||
'serverplugin.cpp',
|
||||
'utility.cpp',
|
||||
]
|
||||
|
||||
if target_machine.system() == 'linux'
|
||||
build_target('server',
|
||||
target_type: 'shared_library',
|
||||
override_options: 'b_lundef=false',
|
||||
sources: loader_src,
|
||||
include_directories: [
|
||||
sourcehook_inc,
|
||||
],
|
||||
name_prefix: '',
|
||||
cpp_args: [
|
||||
'-DLIB_PREFIX=""',
|
||||
'-DLIB_SUFFIX=".so"',
|
||||
]
|
||||
)
|
||||
|
||||
if target_machine.cpu_family() == 'x86_64'
|
||||
build_target('libserver',
|
||||
target_type: 'shared_library',
|
||||
override_options: 'b_lundef=false',
|
||||
sources: loader_src,
|
||||
include_directories: [
|
||||
sourcehook_inc,
|
||||
],
|
||||
name_prefix: '',
|
||||
cpp_args: [
|
||||
'-DLIB_PREFIX="lib"',
|
||||
'-DLIB_SUFFIX=".so"',
|
||||
]
|
||||
)
|
||||
elif target_machine.cpu_family() == 'x86'
|
||||
build_target('server_i486',
|
||||
target_type: 'shared_library',
|
||||
override_options: 'b_lundef=false',
|
||||
sources: loader_src,
|
||||
include_directories: [
|
||||
sourcehook_inc,
|
||||
],
|
||||
cpp_args: [
|
||||
'-DLIB_PREFIX=""',
|
||||
'-DLIB_SUFFIX="_i486.so"',
|
||||
]
|
||||
)
|
||||
endif
|
||||
else
|
||||
build_target('server',
|
||||
target_type: 'shared_library',
|
||||
override_options: 'b_lundef=false',
|
||||
sources: loader_src,
|
||||
include_directories: [
|
||||
sourcehook_inc,
|
||||
],
|
||||
)
|
||||
endif
|
||||
78
meson.build
Normal file
78
meson.build
Normal file
@ -0,0 +1,78 @@
|
||||
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',
|
||||
'-DCOMPILER_GCC',
|
||||
], 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
|
||||
|
||||
if target_machine.cpu_family() == 'x86_64'
|
||||
add_project_arguments('-DPLATFORM_64BITS', language: 'cpp')
|
||||
add_project_arguments('-DX64BITS', language: 'cpp')
|
||||
endif
|
||||
|
||||
public_inc = include_directories('public')
|
||||
loader_inc = include_directories('loader')
|
||||
core_inc = include_directories('core')
|
||||
sourcehook_inc = include_directories('core/sourcehook')
|
||||
amtl_inc = include_directories('third_party/amtl')
|
||||
|
||||
subdir('versionlib')
|
||||
subdir('loader')
|
||||
subdir('core')
|
||||
26
meson_options.txt
Normal file
26
meson_options.txt
Normal file
@ -0,0 +1,26 @@
|
||||
option('sdks', type: 'array', choices: [
|
||||
'csgo',
|
||||
'hl2dm',
|
||||
'nucleardawn',
|
||||
'l4d2',
|
||||
'dods',
|
||||
'l4d',
|
||||
'css',
|
||||
'tf2',
|
||||
'insurgency',
|
||||
'sdk2013',
|
||||
'dota',
|
||||
'doi',
|
||||
'orangebox',
|
||||
'blade',
|
||||
'episode1',
|
||||
'bms',
|
||||
'pvkii',
|
||||
'mcv',
|
||||
'darkm',
|
||||
'swarm',
|
||||
'bgt',
|
||||
'eye',
|
||||
'contagion',
|
||||
'cs2',
|
||||
])
|
||||
@ -40,4 +40,4 @@ msvc2015, take two
|
||||
"something witty" - Fishy!
|
||||
thisisawfuldotnetcom
|
||||
iluvwomen99
|
||||
Hi all, I'm new in here!!!!!!!
|
||||
Hi all, I'm new in here!!!!!!!!
|
||||
|
||||
2
subprojects/.gitignore
vendored
Normal file
2
subprojects/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
hl2sdk-*
|
||||
!hl2sdk-*.wrap
|
||||
7
subprojects/hl2sdk-cs2.wrap
Normal file
7
subprojects/hl2sdk-cs2.wrap
Normal file
@ -0,0 +1,7 @@
|
||||
[wrap-git]
|
||||
url = https://github.com/PeakKS/hl2sdk.git
|
||||
revision = cs2
|
||||
depth = 1
|
||||
|
||||
[provide]
|
||||
cs2 = cs2_dep
|
||||
46
versionlib/meson.build
Normal file
46
versionlib/meson.build
Normal file
@ -0,0 +1,46 @@
|
||||
fs = import('fs')
|
||||
metamod_version_string = fs.read('../product.version').strip()
|
||||
|
||||
version_tag = metamod_version_string.split('-')
|
||||
|
||||
version = version_tag[0].split('.')
|
||||
major = version[0]
|
||||
minor = version[1]
|
||||
release = version[2]
|
||||
|
||||
tag = version_tag[1]
|
||||
|
||||
revision = run_command('git', 'rev-list', '--count', 'HEAD', check: true).stdout().strip()
|
||||
shorthash = run_command('git', 'log', '--pretty=format:%h', '-n', '1', check: true).stdout().strip()
|
||||
product = '.'.join(major, minor, release)
|
||||
|
||||
if tag != ''
|
||||
product += '-' + tag
|
||||
if tag == 'dev'
|
||||
product += '+' + revision
|
||||
endif
|
||||
endif
|
||||
|
||||
metamod_version_config = configuration_data({
|
||||
'tag': tag,
|
||||
'shorthash': shorthash,
|
||||
'major': major,
|
||||
'minor': minor,
|
||||
'release': release,
|
||||
'product': product,
|
||||
'revision': revision,
|
||||
})
|
||||
|
||||
configure_file(
|
||||
input: 'metamod_version_auto.h.in',
|
||||
output: 'metamod_version_auto.h',
|
||||
configuration: metamod_version_config
|
||||
)
|
||||
|
||||
versionlib = static_library(
|
||||
'version',
|
||||
'versionlib.cpp',
|
||||
include_directories: [
|
||||
public_inc,
|
||||
]
|
||||
)
|
||||
16
versionlib/metamod_version_auto.h.in
Normal file
16
versionlib/metamod_version_auto.h.in
Normal file
@ -0,0 +1,16 @@
|
||||
#ifndef _METAMOD_AUTO_VERSION_INFORMATION_H_
|
||||
#define _METAMOD_AUTO_VERSION_INFORMATION_H_
|
||||
|
||||
#define MMS_BUILD_TAG "@tag@"
|
||||
#define MMS_BUILD_CSET "@shorthash@"
|
||||
#define MMS_BUILD_MAJOR "@major@"
|
||||
#define MMS_BUILD_MINOR "@minor@"
|
||||
#define MMS_BUILD_RELEASE "@release@"
|
||||
#define MMS_BUILD_LOCAL_REV "@revision@"
|
||||
|
||||
#define MMS_BUILD_UNIQUEID "@revision@:" MMS_BUILD_CSET
|
||||
|
||||
#define MMS_VERSION_STRING "@product@"
|
||||
#define MMS_VERSION_FILE @major@,@minor@,@release@,0
|
||||
|
||||
#endif /* _METAMOD_AUTO_VERSION_INFORMATION_H_ */
|
||||
Loading…
Reference in New Issue
Block a user