forked from openscan-lsm/OpenScan-BH_SPC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
147 lines (130 loc) · 3.28 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
project('OpenScanBHSPC', 'c', 'cpp', default_options: ['warning_level=2'])
cc = meson.get_compiler('c')
if cc.get_id() != 'msvc' and cc.get_id() != 'clang-cl'
error('Unsupported compiler (requires msvc or clang-cl)')
endif
if build_machine.cpu_family() == 'x86_64'
programsx86 = 'C:/Program Files (x86)'
else
programsx86 = 'C:/Program Files'
endif
host_cpu = host_machine.cpu_family()
if host_cpu == 'x86_64'
spcm_suffix = '64'
elif host_cpu == 'x86'
spcm_suffix = ''
else
error(f'Unsupported host CPU family: @host_cpu@')
endif
bh_spcm_dir = programsx86 / 'BH/SPCM'
bh_spcm_inc = include_directories(bh_spcm_dir / 'DLL')
bh_spcm_dep = declare_dependency(
dependencies: cc.find_library(f'spcm@spcm_suffix@',
dirs: bh_spcm_dir / f'DLL/LIB/MSVC@spcm_suffix@',
has_headers: 'Spcm_def.h',
header_include_directories: bh_spcm_inc,
),
include_directories: bh_spcm_inc,
)
python_prog = find_program('python')
fix_header_script = files('fix-SPC_data_file_structure-header.py')
fixed_headers = custom_target(
'fix-headers',
command: [
python_prog,
fix_header_script,
'@INPUT@',
'@OUTPUT@',
],
input: bh_spcm_dir / 'SPC_data_file_structure.h',
output: 'SPC_data_file_structure_fixed.h',
)
libzip_dep = dependency(
'libzip',
fallback: 'libzip',
default_options: ['vcpkgdir=' + get_option('vcpkgdir')],
static: true,
)
rapidjson_dep = dependency(
'rapidjson',
fallback: ['rapidjson', 'rapidjson_dep'],
)
shlwapi_dep = cc.find_library('shlwapi')
ws2_32_dep = cc.find_library('Ws2_32')
flimevents_dep = dependency(
'FLIMEvents',
fallback: 'FLIMEvents',
)
flimevents_example_inc = subproject('FLIMEvents').get_variable('example_inc')
openscandevicelib_dep = dependency(
'OpenScanDeviceLib',
fallback: ['OpenScanLib', 'OpenScanDeviceLib'],
static: true,
default_options: [
'devicelib=enabled',
'apilib=disabled',
'docs=disabled',
'tests=disabled',
],
)
src = files(
'src/AcquisitionControl.cpp',
'src/BH_SPC150.c',
'src/BH_SPC150Settings.c',
'src/DataStream.cpp',
'src/FIFOAcquisition.cpp',
'src/RateCounters.cpp',
'src/SDTFile/SDTFile.c',
'src/SDTFile/ZipCompress.c',
'src/UniqueFileName.c',
)
osdev = shared_module(
'OpenScanBHSPC',
[
src,
fixed_headers,
],
name_suffix: 'osdev',
c_args: [
'-DNOMINMAX',
'-D_CRT_SECURE_NO_WARNINGS',
],
cpp_args: [
'-DNOMINMAX',
'-D_CRT_SECURE_NO_WARNINGS',
],
include_directories: [
include_directories('src'),
include_directories('src/SDTFile'),
include_directories('src/Sender'),
],
dependencies: [
bh_spcm_dep,
libzip_dep,
rapidjson_dep,
shlwapi_dep,
ws2_32_dep,
flimevents_dep,
openscandevicelib_dep,
],
)
replay = executable(
'ReplaySPC',
[
'src/Replay/Replay.cpp',
],
cpp_args: [
'-DNOMINMAX',
'-D_CRT_SECURE_NO_WARNINGS',
],
include_directories: [
include_directories('src'),
include_directories('src/Sender'),
flimevents_example_inc,
],
dependencies: [
rapidjson_dep,
flimevents_dep,
ws2_32_dep,
],
)