From 81776b1c19aab7009ca38b56158ff281928f85e8 Mon Sep 17 00:00:00 2001 From: Takase <20792268+takase1121@users.noreply.github.com> Date: Tue, 10 Jan 2023 05:50:26 +0800 Subject: [PATCH] Reorganize resources/ + wasm target (#1244) * add README.md to resources directory * add cross/ directory for meson cross files * fix readme list syntax error * fix reflink * disable ASYNCIFY_ADVISE by default * use executable names instead of hardcoding paths --- resources/README.md | 23 ++++++++++ .../macos_arm64.txt} | 3 ++ resources/cross/wasm.txt | 46 +++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 resources/README.md rename resources/{macos/macos_arm64.conf => cross/macos_arm64.txt} (78%) create mode 100644 resources/cross/wasm.txt diff --git a/resources/README.md b/resources/README.md new file mode 100644 index 00000000..975881c4 --- /dev/null +++ b/resources/README.md @@ -0,0 +1,23 @@ +# Resources + +This folder contains resources that is used for building or packaging the project. + +### Build + +- `cross/*.txt`: Meson [cross files][1] for cross-compiling lite-xl on other platforms. + +### Packaging + +- `icons/icon.{icns,ico,inl,rc,svg}`: lite-xl icon in various formats. +- `linux/org.lite_xl.lite_xl.appdata.xml`: AppStream metadata. +- `linux/org.lite_xl.lite_xl.desktop`: Desktop file for Linux desktops. +- `macos/appdmg.png`: Background image for packaging MacOS DMGs. +- `macos/Info.plist.in`: Template for generating `info.plist` on MacOS. See `macos/macos-retina-display.md` for details. +- `windows/001-lua-unicode.diff`: Patch for allowing Lua to load files with UTF-8 filenames on Windows. + +### Development + +- `lite_xl_plugin_api.h`: Native plugin API header. See the contents of `lite_xl_plugin_api.h` for more details. + + +[1]: https://mesonbuild.com/Cross-compilation.html \ No newline at end of file diff --git a/resources/macos/macos_arm64.conf b/resources/cross/macos_arm64.txt similarity index 78% rename from resources/macos/macos_arm64.conf rename to resources/cross/macos_arm64.txt index b1371b3b..3ccc6aa5 100644 --- a/resources/macos/macos_arm64.conf +++ b/resources/cross/macos_arm64.txt @@ -1,3 +1,6 @@ +# cross file for compiling on MacOS ARM (Apple Sillicon). +# use this file by running meson setup --cross-file resources/cross/macos_arm64.txt + [host_machine] system = 'darwin' cpu_family = 'aarch64' diff --git a/resources/cross/wasm.txt b/resources/cross/wasm.txt new file mode 100644 index 00000000..a6e87a06 --- /dev/null +++ b/resources/cross/wasm.txt @@ -0,0 +1,46 @@ +# cross file for WASM. +# use this file by running meson setup --cross-file resources/cross/wasm.txt + +[constants] + +# a list of functions that can run without being asyncified; proceed with caution +asyncify_ignores = '["SDL_BlitScaled","SDL_UpperBlitScaled","SDL_MapRGB*","SDL_FillRect","SDL_FreeSurface","SDL_CreateRGBSurface","SDL_GetWindowSurface","SDL_PollEvent","SDL_CreateSystemCursor","SDL_SetWindowTitle","SDL_SetCursor","SDL_GetWindowSize","SDL_GetWindowPosition","lua_push*","lua_rawget*","luaL_check*","pcre2*","FT_*","Bezier_*","g_*","FT_*","ft_*","TT_*","tt_*","__*","*printf","gray_*","fopen","fclose","fread","fflush","qsort","sift"]' + +# enable advising for optimizing the list above; disable this to prevent flooding logs +asyncify_advise = '0' + +# initial heap size in bytes; make sure it is not too low (around 64mb - 250mb) +initial_heap = '104857600' + + +[binaries] +c = 'emcc' +cpp = 'em++' +ar = 'emar' +strip = 'emstrip' +cmake = ['emmake', 'cmake'] +pkg-config = ['emconfigure', 'pkg-config'] +sdl2-config = ['emconfigure', 'sdl2-config'] + + +[properties] +needs_exe_wrapper = true + + +[built-in options] +c_args = [] +c_link_args = [] +cpp_args = [] +cpp_link_args = [] + + +[project options] +buildtype = 'release' +c_link_args = ['-s', 'ALLOW_MEMORY_GROWTH=1', '-s', 'INITIAL_MEMORY=' + initial_heap, '-s', 'ASYNCIFY=1', '-s', 'ASYNCIFY_ADVISE=' + asyncify_advise, '-s', 'ASYNCIFY_STACK_SIZE=6144', '-s', 'ASYNCIFY_REMOVE=' + asyncify_ignores, '-s', 'FORCE_FILESYSTEM=1'] + + +[host_machine] +system = 'emscripten' +cpu_family = 'wasm32' +cpu = 'wasm32' +endian = 'little'