meson.build 986 B

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