project('neko-player', ['c', 'cpp'], version : '0.1', default_options : ['warning_level=3', 'cpp_std=c++20']) cmake = import('cmake') if get_option('debug') add_global_arguments('-DDEBUG', language: 'cpp') endif if get_option('gles') add_global_arguments('-DIMGUI_IMPL_OPENGL_ES2', language: 'cpp') endif # SDL Mixer X smx_opts = cmake.subproject_options() smx_opts.add_cmake_defines({'SDL_MIXER_X_STATIC': true, 'SDL_MIXER_X_SHARED': false, 'USE_MIDI_NATIVE_ALT': false, 'USE_MIDI_NATIVE': false}) smx_opts.set_override_option('c_std', 'c99') smx_subproj = cmake.subproject('SDL-Mixer-X', options: smx_opts) opts = [] deps = [ dependency('sdl2'), dependency('SDL2_image'), dependency('gl'), subproject('jsoncpp').get_variable('jsoncpp_dep'), dependency('soundtouch'), smx_subproj.dependency('SDL2_mixer_ext_Static') ] if get_option('portals') and host_machine.system() == 'linux' # Dbus CXX deps += dependency('libportal') opts += '-DPORTALS' endif srcs = [ 'main.cpp', 'playback.cpp', 'theme.cpp', 'file_browser.cpp', 'imgui/imgui.cpp', 'imgui/imgui_widgets.cpp', 'imgui/imgui_tables.cpp', 'imgui/imgui_draw.cpp', 'imgui/imgui_demo.cpp', 'imgui/backends/imgui_impl_sdl2.cpp', 'imgui/backends/imgui_impl_opengl3.cpp', ] include_dirs = [ 'imgui', 'imgui/backends', 'imgui-filebrowser', 'IconFontCppHeaders', 'assets', ] res = run_command('./assets/update-assets.sh', check: true) # Validate MetaInfo file metainfo_file = '/path/to/com.experimentalcraft.NekoPlayer.metainfo.xml' ascli_exe = find_program('appstreamcli', required: false) if ascli_exe.found() test('validate metainfo file', ascli_exe, args: ['validate', '--no-net', '--pedantic', metainfo_file] ) endif install_data('assets/icon.svg', rename: 'neko-player.svg', install_dir: 'share/icons/hicolor/scalable/apps/') install_data('assets/neko-player.desktop', install_dir: 'share/applications') install_data('assets/com.experimentalcraft.NekoPlayer.metainfo.xml', install_dir: 'share/metainfo') exe = executable('neko-player', srcs, dependencies: deps, include_directories: include_dirs, install : true, cpp_args: opts)