2018-10-28 02:55:12 +02:00
|
|
|
libcubescript_src = [
|
2021-03-22 21:26:05 +01:00
|
|
|
'cs_bcode.cc',
|
2021-03-22 22:33:01 +01:00
|
|
|
'cs_error.cc',
|
2018-10-28 02:55:12 +02:00
|
|
|
'cs_gen.cc',
|
2021-03-22 22:33:01 +01:00
|
|
|
'cs_ident.cc',
|
2021-03-23 02:00:11 +01:00
|
|
|
'cs_parser.cc',
|
2021-03-23 01:11:21 +01:00
|
|
|
'cs_state.cc',
|
2021-03-25 01:37:13 +01:00
|
|
|
'cs_std.cc',
|
2021-03-23 01:25:47 +01:00
|
|
|
'cs_strman.cc',
|
2021-03-24 22:37:53 +01:00
|
|
|
'cs_thread.cc',
|
2018-10-28 02:55:12 +02:00
|
|
|
'cs_val.cc',
|
|
|
|
'cs_vm.cc',
|
2021-03-23 02:43:00 +01:00
|
|
|
'lib_base.cc',
|
2018-10-28 02:55:12 +02:00
|
|
|
'lib_list.cc',
|
|
|
|
'lib_math.cc',
|
|
|
|
'lib_str.cc'
|
|
|
|
]
|
|
|
|
|
2021-04-07 01:58:58 +02:00
|
|
|
lib_cxxflags = extra_cxxflags + [ '-DLIBCUBESCRIPT_BUILD' ]
|
|
|
|
dyn_cxxflags = lib_cxxflags
|
|
|
|
|
|
|
|
lib_incdirs = libcubescript_includes + [include_directories('.')]
|
|
|
|
|
2021-03-31 01:10:58 +02:00
|
|
|
host_system = host_machine.system()
|
2021-04-07 01:58:58 +02:00
|
|
|
os_uses_dlls = (host_system == 'windows' or host_system == 'cygwin')
|
2021-03-31 01:10:58 +02:00
|
|
|
|
2021-04-07 01:58:58 +02:00
|
|
|
if os_uses_dlls
|
|
|
|
dyn_cxxflags += '-DLIBCUBESCRIPT_DLL'
|
2021-03-31 01:10:58 +02:00
|
|
|
endif
|
|
|
|
|
2021-04-07 01:58:58 +02:00
|
|
|
if os_uses_dlls and get_option('default_library') == 'both'
|
|
|
|
# we need a bunch of this nonsense on windows as both_libraries()
|
|
|
|
# does not work reliably there; since DLLs work like they do, we
|
|
|
|
# need to compile one set of object files with dllexport and the
|
|
|
|
# other set without that, and there is no way to tell meson to
|
|
|
|
# do that other than making two different targets...
|
|
|
|
libcubescript_static = static_library('cubescript',
|
|
|
|
libcubescript_src, include_directories: lib_incdirs,
|
|
|
|
cpp_args: lib_cxxflags,
|
|
|
|
install: true
|
|
|
|
)
|
|
|
|
libcubescript_dynamic = shared_library('cubescript',
|
|
|
|
libcubescript_src, include_directories: lib_incdirs,
|
|
|
|
cpp_args: dyn_cxxflags,
|
|
|
|
install: true,
|
|
|
|
version: meson.project_version()
|
|
|
|
)
|
|
|
|
libcubescript_target = libcubescript_dynamic
|
|
|
|
else
|
|
|
|
libcubescript_target = library('cubescript',
|
|
|
|
libcubescript_src, include_directories: lib_incdirs,
|
|
|
|
cpp_args: dyn_cxxflags,
|
|
|
|
install: true,
|
|
|
|
version: meson.project_version()
|
|
|
|
)
|
|
|
|
endif
|
2018-10-28 02:55:12 +02:00
|
|
|
|
|
|
|
libcubescript = declare_dependency(
|
|
|
|
include_directories: libcubescript_includes,
|
2021-03-23 02:48:14 +01:00
|
|
|
link_with: libcubescript_target
|
2018-10-28 02:55:12 +02:00
|
|
|
)
|