-
Notifications
You must be signed in to change notification settings - Fork 198
/
meson.build
111 lines (98 loc) · 2.37 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
project('AdsLib', 'cpp',
version : '0.1',
default_options : [
'buildtype=release',
'warning_level=3',
'werror=true',
'b_pie=true',
]
)
# some hardening options
add_project_arguments('-D_FORTIFY_SOURCE=2', language: 'cpp')
add_project_arguments(get_option('default_loglevel'), language: 'cpp')
common_files = files([
'AdsLib/AdsDef.cpp',
'AdsLib/AdsDevice.cpp',
'AdsLib/AdsFile.cpp',
'AdsLib/AdsLib.cpp',
'AdsLib/MasterDcStatAccess.cpp',
'AdsLib/ECatAccess.cpp',
'AdsLib/Frame.cpp',
'AdsLib/LicenseAccess.cpp',
'AdsLib/Log.cpp',
'AdsLib/RTimeAccess.cpp',
'AdsLib/RegistryAccess.cpp',
'AdsLib/RouterAccess.cpp',
'AdsLib/Sockets.cpp',
'AdsLib/SymbolAccess.cpp',
'AdsLib/bhf/ParameterList.cpp',
])
router_files = files([
'AdsLib/standalone/AdsLib.cpp',
'AdsLib/standalone/AmsConnection.cpp',
'AdsLib/standalone/AmsNetId.cpp',
'AdsLib/standalone/AmsPort.cpp',
'AdsLib/standalone/AmsRouter.cpp',
'AdsLib/standalone/NotificationDispatcher.cpp',
])
inc = include_directories([
'AdsLib',
'tools',
])
libs = [
meson.get_compiler('cpp').find_library('ws2_32', required: false),
dependency('threads'),
]
adslib = static_library('AdsLib',
[common_files, router_files],
include_directories: inc,
install: true,
)
adslib_dep = declare_dependency(
include_directories : inc,
link_with: adslib,
)
adslibtest = executable('AdsLibTest',
'AdsLibTest/main.cpp',
include_directories: inc,
dependencies: libs,
link_with: adslib,
)
adslibooitest = executable('AdsLibOOITest',
'AdsLibOOITest/main.cpp',
include_directories: inc,
dependencies: libs,
link_with: adslib,
)
adstool = executable('adstool',
'AdsTool/main.cpp',
include_directories: inc,
dependencies: libs,
link_with: adslib,
)
if get_option('tcadsdll_include') != ''
tcadslib = static_library('TcAdsLib',
[common_files, 'AdsLib/TwinCAT/AdsLib.cpp'],
cpp_args: '-DUSE_TWINCAT_ROUTER',
include_directories: [
get_option('tcadsdll_include'),
inc,
],
)
tcadsdll_deps = [
meson.get_compiler('cpp').find_library('TcAdsDll', dirs: get_option('tcadsdll_lib')),
libs,
]
tcadstool = executable('tcadstool',
'AdsTool/main.cpp',
cpp_args: '-DUSE_TWINCAT_ROUTER',
include_directories: [
get_option('tcadsdll_include'),
inc,
],
dependencies: [
tcadsdll_deps
],
link_with: tcadslib,
)
endif