-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmeson.build
44 lines (33 loc) · 1.11 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
project('high_dpi_hook', 'cpp',
version : '0.1',
default_options : ['warning_level=3', 'cpp_std=c++14'])
### configuration part
dllname = 'winmm'
system32 = 'C:\\Windows\\System32'
conf_data = configuration_data()
conf_data.set('dllname', dllname)
configure_file(input : 'dllname.h.in',
output : 'dllname.h',
configuration : conf_data)
dllpath = system32 + '\\' + dllname + '.dll'
compiler_id = meson.get_compiler('cpp').get_id()
### export table generation part
generate_command = ['python', files('extract_exports.py'), dllpath]
if compiler_id == 'msvc'
generate_command += '--use-noname'
endif
gen_files = custom_target('gen_files',
input : ['extract_exports.py', dllpath],
command : generate_command,
output : ['func_defs.inc', 'exports.def'])
### compiler part
if compiler_id == 'msvc'
link_args = ['shcore.lib', '/def:exports.def'] # shcore.dll is only needed by hidpi_hook
else
link_args = [system32 + '\\shcore.dll', 'exports.def']
endif
libhook = shared_library('hook',
'dll_hook.cc',
'hidpi_hook.cc',
gen_files,
link_args : link_args)