document tiny flag; have it use flto on clang

This commit is contained in:
IoI_xD 2026-03-31 17:15:25 -07:00
commit cce41b32b8
2 changed files with 12 additions and 0 deletions

8
doc/TINYCONFIG.md Normal file
View file

@ -0,0 +1,8 @@
# Tiny Config
Milsko's configure script supports the `--tiny` option for building the tiniest possible Milsko library (~400kb as of writing). Currently, what it does is:
- Add `-Oz` to the cflags
- (clang only) add `-flto=thin` to the cflags and linker flags
- Build stb-image with `STB_IMAGE_STATIC` (this is why you get warnings with stb_image when you use it)
- Disable the Wayland backend

View file

@ -3,6 +3,10 @@ new_object("src/*.c");
my $gl_libs = "";
if (param_get("tiny")) {
add_cflags("-Oz");
if(defined($ENV{CC}) && grep(/^clang$/, $ENV{CC})) {
add_libs("-flto=thin");
add_cflags("-flto=thin");
}
}
if (param_get("classic-theme")) {
add_cflags("-DUSE_CLASSIC_THEME");