-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmeson.build
36 lines (25 loc) · 1.23 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
project('harmony', 'cpp', default_options : ['warning_level=3', 'cpp_debugstl=true'], meson_version : '>=0.50.0')
#インクルードディレクトリ
include_dir = include_directories('include')
if not meson.is_subproject()
#コンパイルオプション調整
cppcompiler = meson.get_compiler('cpp').get_argument_syntax()
if cppcompiler == 'msvc'
options = ['/std:c++latest', '/source-charset:utf-8', '/Zc:__cplusplus']
elif cppcompiler == 'gcc'
options = ['-std=c++2a']
endif
#VSプロジェクトに編集しうるファイルを追加する
vs_files = ['include/harmony.hpp']
#依存プロジェクト
boostut_proj = subproject('boost.ut')
boostut_dep = boostut_proj.get_variable('boostut_dep')
tlexpected_proj = subproject('expected')
tlexpected_dep = tlexpected_proj.get_variable('tlexpected_dep')
thread_dep = dependency('threads')
exe = executable('harmony_test', 'test/harmony_test.cpp', include_directories : include_dir, extra_files : vs_files, cpp_args : options, dependencies : [boostut_dep, tlexpected_dep, thread_dep])
test('harmony test', exe)
else
# subprojectとして構築時は依存オブジェクトの宣言だけしとく
harmony_dep = declare_dependency(include_directories : include_directories('include'))
endif