hibiscus/meson.build

41 lines
1.8 KiB
Meson
Raw Normal View History

2023-06-26 18:46:11 +00:00
project('hibis', 'cpp', 'c', version: '0.0.0' + (not get_option('buildtype').startswith('release') ? '-' + run_command('git', 'rev-parse', '--short', 'HEAD', check: true).stdout().strip() : ''),
2023-05-26 21:41:51 +00:00
license: 'LGPL-3.0-only', meson_version: '>=0.60.3', default_options: ['cpp_std=c++17'])
2023-06-26 18:46:11 +00:00
# Imports
cmake = import('cmake')
2023-05-26 21:41:51 +00:00
# Configure data
confdata = configuration_data()
confdata.set('version', meson.project_version())
configure_file(input: 'core/enginever.in.hpp', output: 'enginever.hpp', configuration: confdata)
# Include Directory
2023-05-30 16:00:39 +00:00
include_dirs = include_directories('./external')
2023-05-26 21:41:51 +00:00
# Files
libhibis_src_core = files('core/engine/engine.cpp')
2023-06-01 19:19:18 +00:00
libhibis_src_renderer = files('core/renderer/renderer.cpp')
2023-06-28 20:43:01 +00:00
libhibis_src_resources = files('core/resources/font.cpp', 'core/resources/shader.cpp')
2023-06-01 19:19:18 +00:00
libhibis_src = [libhibis_src_core, libhibis_src_renderer, libhibis_src_resources]
2023-05-26 21:41:51 +00:00
2023-06-26 18:46:11 +00:00
libhibis_rwgpu_src = files('renderer/rwgpu/rwgpu.cpp')
2023-05-26 21:41:51 +00:00
libhibis_test_src = files('test/app.cpp')
# Dependencies
libgl = dependency('gl')
libglfw = dependency('glfw3')
libglew = dependency('GLEW')
2023-05-26 21:41:51 +00:00
libfmt = dependency('fmt')
2023-06-26 18:46:11 +00:00
libwgpu = meson.get_compiler('cpp').find_library('wgpu_native')
libwgpu_glfw = static_library('glfw3webgpu', 'external/glfw3webgpu/glfw3webgpu.c', dependencies: [libglfw])
libfreetype2 = dependency('freetype2')
2023-05-26 21:41:51 +00:00
# Compile
2023-06-01 19:19:18 +00:00
libhibis = library('hibis', libhibis_src, include_directories: include_dirs, dependencies: [libfreetype2])
2023-06-26 18:46:11 +00:00
libhibis_rwgpu = library('hibis_rwgpu', libhibis_rwgpu_src, include_directories: [include_dirs, './core'], link_with: [libhibis, libwgpu_glfw], dependencies: [libfreetype2, libglfw, libfmt, libwgpu])
hibistest = executable('hibistest.exec', libhibis_test_src, include_directories: [include_dirs, './core', './renderer/rwgpu'], link_with: [libhibis, libhibis_rwgpu], dependencies: [libfreetype2, libglfw, libfmt, libwgpu])