mirror of
https://github.com/luanti-org/luanti.git
synced 2025-12-19 21:35:46 +01: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:
@@ -210,7 +210,7 @@ void GUITable::setTable(const TableOptions &options,
|
||||
s32 colcount = columns.size();
|
||||
assert(colcount >= 1);
|
||||
// rowcount = ceil(cellcount / colcount) but use integer arithmetic
|
||||
s32 rowcount = (content.size() + colcount - 1) / colcount;
|
||||
s32 rowcount = std::min(((u32)content.size() + colcount - 1) / colcount, (u32)S32_MAX);
|
||||
assert(rowcount >= 0);
|
||||
// Append empty strings to content if there is an incomplete row
|
||||
s32 cellcount = rowcount * colcount;
|
||||
|
||||
Reference in New Issue
Block a user