initial commit
This commit is contained in:
28
angelscript/projects/meson/detect_ver.py
Normal file
28
angelscript/projects/meson/detect_ver.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import argparse
|
||||
import os
|
||||
import re
|
||||
|
||||
HEADER = os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
||||
"..", "..", "include", "angelscript.h")
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--num", action="store_true", help="Print numeric version")
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.num:
|
||||
regex = re.compile(r'^#define ANGELSCRIPT_VERSION\s+(\d+)')
|
||||
else:
|
||||
regex = re.compile(r'^#define ANGELSCRIPT_VERSION_STRING\s+"(\d+\.\d+\.\d+.*)"')
|
||||
|
||||
with open(HEADER, "r") as fobj:
|
||||
for l in fobj:
|
||||
match = re.match(regex, l)
|
||||
if match is not None:
|
||||
print(match.group(1))
|
||||
return
|
||||
|
||||
assert False, "Can't find version"
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
68
angelscript/projects/meson/meson.build
Normal file
68
angelscript/projects/meson/meson.build
Normal file
@@ -0,0 +1,68 @@
|
||||
project('angelscript', 'cpp',
|
||||
version : run_command(find_program('python3'), 'detect_ver.py').stdout().strip(),
|
||||
meson_version : '>=0.28.0',
|
||||
license : 'zlib')
|
||||
|
||||
threads = dependency('threads')
|
||||
|
||||
angel_srcs = [
|
||||
'../../source/as_atomic.cpp',
|
||||
'../../source/as_builder.cpp',
|
||||
'../../source/as_bytecode.cpp',
|
||||
'../../source/as_callfunc.cpp',
|
||||
'../../source/as_callfunc_mips.cpp',
|
||||
'../../source/as_callfunc_ppc.cpp',
|
||||
'../../source/as_callfunc_ppc_64.cpp',
|
||||
'../../source/as_callfunc_sh4.cpp',
|
||||
'../../source/as_callfunc_x86.cpp',
|
||||
'../../source/as_callfunc_x64_gcc.cpp',
|
||||
'../../source/as_callfunc_x64_mingw.cpp',
|
||||
'../../source/as_compiler.cpp',
|
||||
'../../source/as_context.cpp',
|
||||
'../../source/as_configgroup.cpp',
|
||||
'../../source/as_datatype.cpp',
|
||||
'../../source/as_generic.cpp',
|
||||
'../../source/as_gc.cpp',
|
||||
'../../source/as_globalproperty.cpp',
|
||||
'../../source/as_memory.cpp',
|
||||
'../../source/as_module.cpp',
|
||||
'../../source/as_objecttype.cpp',
|
||||
'../../source/as_outputbuffer.cpp',
|
||||
'../../source/as_parser.cpp',
|
||||
'../../source/as_restore.cpp',
|
||||
'../../source/as_scriptcode.cpp',
|
||||
'../../source/as_scriptengine.cpp',
|
||||
'../../source/as_scriptfunction.cpp',
|
||||
'../../source/as_scriptnode.cpp',
|
||||
'../../source/as_scriptobject.cpp',
|
||||
'../../source/as_string.cpp',
|
||||
'../../source/as_string_util.cpp',
|
||||
'../../source/as_thread.cpp',
|
||||
'../../source/as_tokenizer.cpp',
|
||||
'../../source/as_typeinfo.cpp',
|
||||
'../../source/as_variablescope.cpp',
|
||||
]
|
||||
if host_machine.cpu_family() == 'arm'
|
||||
add_languages('c')
|
||||
angel_srcs += [
|
||||
'../../source/as_callfunc_arm.cpp',
|
||||
'../../source/as_callfunc_arm_gcc.S',
|
||||
]
|
||||
endif
|
||||
|
||||
angelscript_version_num = run_command(find_program('python3'), 'detect_ver.py', '--num').stdout().strip()
|
||||
angelscript_lib = library(
|
||||
'angelscript',
|
||||
sources : angel_srcs,
|
||||
dependencies : threads,
|
||||
version : angelscript_version_num,
|
||||
install : true,
|
||||
)
|
||||
angelscript_inc = include_directories('../../include')
|
||||
angelscript_dep = declare_dependency(
|
||||
link_with : angelscript_lib,
|
||||
include_directories : angelscript_inc,
|
||||
version : meson.project_version(),
|
||||
)
|
||||
|
||||
install_headers('../../include/angelscript.h')
|
Reference in New Issue
Block a user