-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmeson.build
68 lines (61 loc) · 1.53 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
project(
'tmp',
'cpp',
version: '2.0',
default_options: ['cpp_std=c++17'],
)
include_directory = include_directories('include')
filesystem_proj = subproject('filesystem')
filesystem_dep = filesystem_proj.get_variable('filesystem_dep')
default_library = get_option('default_library')
if default_library != 'static'
dll_usage_args = ['-DTMP_SHARED']
if host_machine.system() == 'windows'
dll_build_args = ['-DTMP_BUILDING_DLL']
else
dll_build_args = []
endif
else
dll_usage_args = []
dll_build_args = []
endif
tmp = library(
'tmp',
'src/create.cpp',
'src/file.cpp',
'src/directory.cpp',
install: true,
include_directories: include_directory,
gnu_symbol_visibility: 'hidden',
version: meson.project_version(),
dependencies: [filesystem_dep],
cpp_args: dll_build_args,
)
tmp_dep = declare_dependency(
link_with: tmp,
include_directories: include_directory,
dependencies: [filesystem_dep],
version: meson.project_version(),
compile_args: dll_usage_args,
)
install_headers(
'include/tmp/directory',
'include/tmp/export',
'include/tmp/file',
subdir: 'tmp',
)
if not meson.is_subproject()
if get_option('build_tests')
subdir('tests')
endif
pkg = import('pkgconfig')
pkg.generate(
tmp,
extra_cflags: dll_usage_args,
libraries: [filesystem_dep],
version: meson.project_version(),
filebase: 'lib' + meson.project_name(),
description: 'RAII-wrappers for unique temporary files and directories for modern C++',
url: 'https://github.com/bugdea1er/tmp',
)
endif