forked from kushview/element
-
Notifications
You must be signed in to change notification settings - Fork 0
/
meson.build
72 lines (60 loc) · 2.27 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
project ('element', ['c', 'cpp' ] + meson.get_external_property ('extra_languages', []),
version : '0.47.0',
meson_version : '>= 0.58.0',
default_options : [ 'c_std=c11', 'cpp_std=c++17' ])
fs = import ('fs')
cpp = meson.get_compiler ('cpp')
# Global Arguments
# Boost
boost_dep = dependency ('boost', required : true)
deps = [ boost_dep ]
# Filesystem
if not cpp.check_header ('filesystem', required : false)
cpp.check_header ('experimental/filesystem', required : true)
if host_machine.system() == 'darwin'
deps += cpp.find_library ('c++fs', required : true)
elif cpp.get_argument_syntax() == 'gcc'
deps += cpp.find_library ('stdc++fs', required : true)
endif
endif
subdir ('libs/lua')
subdir ('libs/compat')
subdir ('scripts')
subdir ('src')
###############################################################################
# Element Application
element_app_link_args = []
element_app_deps = deps
element_app_sources = [ 'src/main.cpp' ]
if host_machine.system() == 'windows'
windows = import ('windows')
element_app_sources += windows.compile_resources ('tools/windeploy/resources.rc',
include_directories : ['tools/windeploy'])
if cpp.get_id() == 'gcc' and cpp.get_argument_syntax() == 'gcc'
foreach l : 'uuid wsock32 wininet version ole32 ws2_32 oleaut32 imm32 comdlg32 shlwapi rpcrt4 winmm dxgi'.split()
element_app_deps += cpp.find_library (l, required : true)
endforeach
element_app_link_args += [ '-static-libgcc', '-static-libstdc++',
'-Wl,-Bstatic,--whole-archive', '-lwinpthread',
'-Wl,--no-whole-archive' ]
endif
endif
subdir ('test')
if not meson.is_subproject()
element_app = executable ('element', element_app_sources,
install : true,
win_subsystem : 'windows',
gnu_symbol_visibility : 'hidden',
dependencies : element_app_deps,
include_directories : [ 'src', libelement_includes ],
link_args : element_app_link_args,
link_with : [ libelement ])
subdir ('src/plugins')
if host_machine.system() == 'linux'
subdir ('tools/lindeploy')
elif host_machine.system() == 'darwin'
subdir ('tools/macdeploy')
elif host_machine.system() == 'windows'
subdir ('tools/windeploy')
endif
endif