document tiny flag; have it use flto on clang
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
This commit is contained in:
parent
a00d4ba144
commit
cce41b32b8
2 changed files with 12 additions and 0 deletions
8
doc/TINYCONFIG.md
Normal file
8
doc/TINYCONFIG.md
Normal 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
|
||||||
|
|
@ -3,6 +3,10 @@ new_object("src/*.c");
|
||||||
my $gl_libs = "";
|
my $gl_libs = "";
|
||||||
if (param_get("tiny")) {
|
if (param_get("tiny")) {
|
||||||
add_cflags("-Oz");
|
add_cflags("-Oz");
|
||||||
|
if(defined($ENV{CC}) && grep(/^clang$/, $ENV{CC})) {
|
||||||
|
add_libs("-flto=thin");
|
||||||
|
add_cflags("-flto=thin");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (param_get("classic-theme")) {
|
if (param_get("classic-theme")) {
|
||||||
add_cflags("-DUSE_CLASSIC_THEME");
|
add_cflags("-DUSE_CLASSIC_THEME");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue