mirror of
https://github.com/lc-soft/LCUI.git
synced 2026-11-30 16:48:21 +01:00
build(lcui): ship sub-library headers and merge archives into lcui.lib
This commit is contained in:
@@ -110,3 +110,20 @@ target("lcui")
|
||||
"libui-xml"
|
||||
)
|
||||
add_headerfiles("include/LCUI.h", "include/(LCUI/**.h)")
|
||||
-- lcui is a self-contained package: the umbrella header LCUI.h includes each
|
||||
-- sub-library's flat root header, so those headers must be installed together
|
||||
-- with lcui for consumers to be able to #include <LCUI.h>.
|
||||
-- Iterate over lib/* instead of listing every sub-library: the set of
|
||||
-- sub-libraries changes over time (ui-cursor, ui-router and worker were
|
||||
-- merged away) and the loop adapts on its own. A directory counts as a
|
||||
-- sub-library only when it has its own xmake.lua -- lib/ui-router is a
|
||||
-- leftover holding nothing but a generated config header.
|
||||
for _, subdir in ipairs(os.filedirs("lib/*")) do
|
||||
local incdir = subdir:gsub("\\", "/") .. "/include"
|
||||
if os.isfile(subdir .. "/xmake.lua") and os.isdir(incdir) then
|
||||
add_headerfiles(incdir .. "/(**.h)")
|
||||
end
|
||||
end
|
||||
-- Merge the sub-library archives into lcui.lib so that the published
|
||||
-- library is self-contained, as the xmake registry package expects.
|
||||
set_policy("build.merge_archive", true)
|
||||
|
||||
Reference in New Issue
Block a user