mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-09-27 12:40:19 +00:00
chisel does #include "lua.h" and links libluajit-5.1.so, but the link failed with undefined Lua symbols (luaL_openselectedlibs, lua_setglobal, lua_getglobal, lua_pcallk). Those come from the stock Lua >= 5.4 header, not LuaJIT. The stray stock lua.h reaches the target compile line via ncurses.cmake: find_package(Curses) resolves CURSES_INCLUDE_DIR to the native sysroot (recipe-sysroot-native/usr/include, which also carries ncurses.h/form.h and, dragged in by lua-native, lua.h), then include_directories() places that dir ahead of the LuaJIT include dir. The prior CXXFLAGS -I workaround could not win because CMake orders target include_directories before CMAKE_CXX_FLAGS. Pin CURSES_INCLUDE_DIR/CURSES_LIBRARIES to the target sysroot so the native include dir never leaks into the target build; lua.h then resolves through LUAJIT_INCLUDE and matches the linked library. Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>