Debian Codegraph @

vendored-meson/meson/test cases/windows/7 dll versioning/meson.build

raw
1 project('msvc dll versioning', 'c')
2
3 cc = meson.get_compiler('c')
4
5 # Test that we create correctly-named dll and import lib files,
6 # and also install them in the right place
7 some = shared_library('some', 'lib.c',
8 version : '1.2.3',
9 soversion : '0',
10 install : true)
11
12 noversion = shared_library('noversion', 'lib.c',
13 install : true)
14
15 onlyversion = shared_library('onlyversion', 'lib.c',
16 version : '1.4.5',
17 install : true)
18
19 onlysoversion = shared_library('onlysoversion', 'lib.c',
20 # Also test that int soversion is acceptable
21 soversion : 5,
22 install : true)
23
24 # Hack to make the executables below depend on the shared libraries above
25 # without actually adding them as `link_with` dependencies since we want to try
26 # linking to them with -lfoo linker arguments.
27 cp = find_program('copyfile.py')
28 out = custom_target('library-dependency-hack',
29 input : 'exe.orig.c',
30 output : 'exe.c',
31 depends : [some, noversion, onlyversion, onlysoversion],
32 command : [cp, '@INPUT@', '@OUTPUT@'])
33
34 # Manually test if the linker can find the above libraries
35 # i.e., whether they were generated with the right naming scheme
36 test('manually linked 1', executable('manuallink1', out,
37 link_args : ['-L.', '-lsome']))
38
39 test('manually linked 2', executable('manuallink2', out,
40 link_args : ['-L.', '-lnoversion']))
41
42 test('manually linked 3', executable('manuallink3', out,
43 link_args : ['-L.', '-lonlyversion']))
44
45 test('manually linked 4', executable('manuallink4', out,
46 link_args : ['-L.', '-lonlysoversion']))
47
48 shared_library('customdir', 'lib.c',
49 install : true,
50 install_dir : get_option('libexecdir'))
51
52 shared_module('module', 'lib.c',
53 install : true,
54 install_dir: join_paths(get_option('libdir'), 'modules'))