feat: add SDL App Metadata (#2068)

* add SDL App Metadata

* prefix define with LITE
This commit is contained in:
Jan
2025-05-18 23:16:09 +08:00
committed by takase1121
parent 1ce31b2a00
commit 9408dddb37
2 changed files with 6 additions and 1 deletions
+4 -1
View File
@@ -43,7 +43,10 @@ conf_data.set('PROJECT_ASSEMBLY_VERSION', meson.project_version() + '.0')
cc = meson.get_compiler('c')
lite_includes = []
lite_cargs = ['-DPCRE2_STATIC']
lite_cargs = [
'-DPCRE2_STATIC',
'-DLITE_PROJECT_VERSION_STR="@0@"'.format(version)
]
# On macos we need to use the SDL renderer to support retina displays
if get_option('renderer') or host_machine.system() == 'darwin'
lite_cargs += '-DLITE_USE_SDL_RENDERER'
+2
View File
@@ -120,6 +120,8 @@ int main(int argc, char **argv) {
signal(SIGPIPE, SIG_IGN);
#endif
SDL_SetAppMetadata("Lite XL", LITE_PROJECT_VERSION_STR, "com.lite_xl.LiteXL");
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS)) {
fprintf(stderr, "Error initializing SDL: %s", SDL_GetError());
exit(1);