Skip to content

build(cmake): link LuaJIT when it is used instead of Lua - #962

Open
dktue wants to merge 1 commit into
systemed:masterfrom
dktue:build/cmake-luajit
Open

dktue wants to merge 1 commit into
systemed:masterfrom
dktue:build/cmake-luajit

Conversation

@dktue

@dktue dktue commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Gain: with LuaJIT, a Germany build uses 9% less CPU and is 4% faster, with identical output. Planet (PMTiles, 32 threads): 1,703 → 1,682 s (−1.2%), user CPU −3.5%.

When find_package(Lua) doesn't find Lua, CMakeLists.txt falls back to LuaJIT,
but only links ${LUA_LIBRARIES}, which is then empty, so the link fails. This
links ${LUAJIT_LIBRARIES} as well.

With LuaJIT 2.1 (built with
cmake -DCMAKE_DISABLE_FIND_PACKAGE_Lua=TRUE and LUA_DIR pointing at it),
a Germany build with process-openmaptiles.lua uses 9% less CPU and 4% less
wall time than with Lua 5.3. The output is the same: compared per tile, layer
and tags, every layer matches except poi, which already differs between two
runs with the same binary.

🤖 Generated with Claude Code

When find_package(Lua) fails, CMakeLists.txt falls back to LuaJIT,
but the target only linked LUA_LIBRARIES, which is empty then, so the
link failed. Link LUAJIT_LIBRARIES as well.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant