1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Enable IPO/LTO by default except for debug builds (#14198)

Test case:

```
$ cmake . -DRUN_IN_PLACE=TRUE -DCMAKE_BUILD_TYPE=Release -DBUILD_SERVER=TRUE -DENABLE_TOUCH=FALSE

         minetest minetestserver
W/o LTO:      13M           7.3M
W/  LTO:      11M           5.9M
difference:   15%            19%
```

Also fixes various compiler warnings resulting from compilation using LTO.

---------

Signed-off-by: David Heidelberg <david@ixit.cz>
This commit is contained in:
David Heidelberg 2024-02-09 00:01:12 +01:00 committed by grorp
parent de09cac1e9
commit 35a83c3514
7 changed files with 49 additions and 33 deletions

View file

@ -1,7 +1,8 @@
#! /bin/bash -e
#!/bin/bash -e
cmake -B build \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Debug} \
-DENABLE_LTO=FALSE \
-DRUN_IN_PLACE=TRUE \
-DENABLE_GETTEXT=${CMAKE_ENABLE_GETTEXT:-TRUE} \
-DBUILD_SERVER=${CMAKE_BUILD_SERVER:-TRUE} \