2019-08-19 08:59:35 -04:00
|
|
|
project('mkxp-z', 'cpp', 'c', version: '1.0', default_options: ['cpp_std=c++11'])
|
2019-07-29 07:56:45 -04:00
|
|
|
|
2019-08-20 05:21:30 -04:00
|
|
|
# The meson build is mostly directly copied from the old CMakeLists,
|
|
|
|
# it still needs to be cleaned up
|
|
|
|
|
2019-08-04 12:00:20 -04:00
|
|
|
xxd = find_program('xxd', native: true)
|
2019-07-29 07:56:45 -04:00
|
|
|
host_system = host_machine.system()
|
2019-07-31 10:53:46 -04:00
|
|
|
compiler = meson.get_compiler('cpp')
|
2019-07-29 07:56:45 -04:00
|
|
|
|
2019-08-10 04:35:37 -04:00
|
|
|
if get_option('workdir_current')
|
2019-07-29 08:20:40 -04:00
|
|
|
add_project_arguments('-DWORKDIR_CURRENT', language: 'cpp')
|
|
|
|
endif
|
|
|
|
|
2019-08-20 05:21:30 -04:00
|
|
|
if get_option('use_fakeapi')
|
|
|
|
add_project_arguments('-DUSE_FAKEAPI', language: 'cpp')
|
2019-08-10 03:46:20 -04:00
|
|
|
endif
|
|
|
|
|
2019-08-10 04:35:37 -04:00
|
|
|
if not get_option('console')
|
|
|
|
add_project_arguments('-DNO_CONSOLE', language: 'cpp')
|
|
|
|
endif
|
|
|
|
|
2019-07-29 07:56:45 -04:00
|
|
|
subdir('src')
|
2019-07-31 08:47:44 -04:00
|
|
|
subdir('binding')
|
2019-07-29 07:56:45 -04:00
|
|
|
subdir('shader')
|
|
|
|
subdir('assets')
|
|
|
|
|
2019-07-31 07:04:13 -04:00
|
|
|
all_sources = [main, bindings, processed_shaders, processed_assets]
|
2019-07-31 08:47:44 -04:00
|
|
|
include_dirs = [include_directories('src', 'binding')]
|
2019-07-29 07:56:45 -04:00
|
|
|
|
2019-08-19 08:59:35 -04:00
|
|
|
# Use cwalk
|
|
|
|
all_sources += files('cwalk/src/cwalk.c')
|
|
|
|
include_dirs += include_directories('cwalk/include')
|
|
|
|
|
2019-07-29 07:56:45 -04:00
|
|
|
linker_args = []
|
|
|
|
|
|
|
|
if host_system == 'windows'
|
|
|
|
subdir('windows')
|
|
|
|
all_sources += windows_resources
|
2019-07-30 09:17:20 -04:00
|
|
|
include_dirs += include_directories('windows')
|
2019-07-29 07:56:45 -04:00
|
|
|
elif host_system == 'darwin'
|
2019-07-31 15:33:02 -04:00
|
|
|
if compiler.get_id() == 'clang'
|
2019-08-08 08:48:48 -04:00
|
|
|
add_project_arguments('-stdlib=libc++', language: 'cpp')
|
2019-07-29 07:56:45 -04:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2019-07-31 09:45:12 -04:00
|
|
|
executable(meson.project_name(),
|
2019-07-29 07:56:45 -04:00
|
|
|
sources: all_sources,
|
|
|
|
dependencies: [main_dependencies, binding_dependencies],
|
2019-08-09 07:36:18 -04:00
|
|
|
include_directories: include_dirs,
|
2019-08-09 07:46:51 -04:00
|
|
|
gui_app: (get_option('console') == false)
|
2019-07-29 07:56:45 -04:00
|
|
|
)
|