From d8a8845cb03d77e0a6b0c9bdd653d4343658987c Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Tue, 5 Nov 2024 12:03:33 -0600 Subject: [PATCH] use mold for debug builds --- Makefile | 4 ++-- meson.build | 11 ++++++++--- mingw32.cross | 5 ++++- scripts/prosperon.js | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index bece6e7b..870314b1 100755 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ debug: FORCE meson compile -C build_dbg release: FORCE - meson setup -Dbuildtype=release -Db_lto=true -Db_lto_threads=4 -Db_ndebug=true -Db_pgo=use build_release + meson setup -Dbuildtype=release -Db_lto=true -Db_ndebug=true -Db_pgo=use build_release meson compile -C build_release sanitize: FORCE @@ -11,7 +11,7 @@ sanitize: FORCE meson compile -C build_sani small: FORCE - meson setup -Dbuildtype=minsize -Db_lto=true -Db_lto_threads=4 -Db_ndebug=true -Db_pgo=use build_small + meson setup -Dbuildtype=minsize -Db_lto=true -Db_ndebug=true -Db_pgo=use build_small meson compile -C build_small web: FORCE diff --git a/meson.build b/meson.build index 0677d48c..ce97be91 100644 --- a/meson.build +++ b/meson.build @@ -2,6 +2,8 @@ project('prosperon', ['c', 'cpp'], default_options : [ 'cpp_std=c++11']) libtype = get_option('default_library') +link = [] + if not get_option('editor') add_project_arguments('-DNEDITOR', language:'c') endif @@ -29,13 +31,12 @@ cc = meson.get_compiler('c') if host_machine.system() == 'linux' deps += cc.find_library('asound', required:true) deps += [dependency('x11'), dependency('xi'), dependency('xcursor'), dependency('egl'), dependency('gl')] + link += '-fuse-ld=mold' # use mold, which is very fast, for debug builds endif -link = [] - if host_machine.system() == 'windows' deps += cc.find_library('d3d11') - link += '-static' + link += '-static' # Required to pack in mingw dlls on cross compilation endif if host_machine.system() == 'emscripten' @@ -103,4 +104,8 @@ prosperon = executable('prosperon', sources, link_args: link ) +prosperon_dep = declare_dependency( + link_with:prosperon +) + test('sanity', prosperon) \ No newline at end of file diff --git a/mingw32.cross b/mingw32.cross index d5433e6e..0619815c 100644 --- a/mingw32.cross +++ b/mingw32.cross @@ -10,4 +10,7 @@ exe_wrapper = 'wine64' system = 'windows' cpu_family = 'x86_64' cpu = 'x86_64' -endian = 'little' \ No newline at end of file +endian = 'little' + +[properties] +link_args = ['-static'] \ No newline at end of file diff --git a/scripts/prosperon.js b/scripts/prosperon.js index 3da02133..5494137e 100644 --- a/scripts/prosperon.js +++ b/scripts/prosperon.js @@ -223,7 +223,7 @@ var sheetsize = 1024; function pack_into_sheet(images) { if (!Array.isArray(images)) images = [images]; - if (images[0].texture.width > 3 && images[0].texture.height > 3) return; + if (images[0].texture.width > 300 && images[0].texture.height > 300) return; sheet_frames = sheet_frames.concat(images); var sizes = sheet_frames.map(x => [x.rect.width*x.texture.width, x.rect.height*x.texture.height]); var pos = os.rectpack(sheetsize, sheetsize, sizes);