Debian Codegraph @

manual tests/4 standalone binaries/meson.build

raw
1 project('myapp', 'cpp')
2
3 sdl = dependency('sdl2', required : host_machine.system() != 'windows')
4
5 if meson.get_compiler('cpp').get_id() != 'msvc'
6 add_global_arguments('-std=c++11', language : 'cpp')
7 endif
8
9 if host_machine.system() == 'darwin'
10 install_data('myapp.sh',
11 install_dir : 'Contents/MacOS')
12
13 install_data('myapp.icns',
14 install_dir : 'Contents/Resources')
15
16 install_data('Info.plist',
17 install_dir : 'Contents')
18
19 meson.add_install_script('osx_bundler.sh')
20 endif
21
22 if host_machine.system() == 'linux'
23 install_data('myapp.sh', install_dir : '.')
24 meson.add_install_script('linux_bundler.sh')
25 endif
26
27 extra_link_args = []
28
29 if host_machine.system() == 'windows'
30 str = '-I@0@/@1@'.format(meson.current_build_dir(), 'SDL2-2.0.3/include')
31 add_global_arguments(str, language : 'cpp')
32 extra_link_args = ['/SUBSYSTEM:CONSOLE', 'SDL2main.lib', 'SDL2.lib']
33 endif
34
35 prog = executable('myapp', 'myapp.cpp',
36 dependencies : sdl,
37 link_args : extra_link_args,
38 install : true)