build(xmake): fix package name, target naming and example install

- Remove per-lib set_project() calls that overrode the global lcui
  project name; xmake show now correctly reports the project as lcui.
- Move per-lib set_version() into the corresponding target() block so
  each sub-library keeps an independent version usable for standalone
  packaging.
- Add set_default(false) and set_group(examples) to all pandagl
  examples so they are no longer picked up by xmake package.
- Rename targets to use dashes for consistency:
    pandagl_cairo_example  -> pandagl-cairo-example
    preview_block_layout   -> preview-block-layout
    preview_flex_layout    -> preview-flex-layout
    preview_scrollbar      -> preview-scrollbar
    preview_widget_opacity -> preview-widget-opacity
- Bump yutil submodule to drop its set_project() call as well.
This commit is contained in:
Liu
2026-06-01 22:27:07 +08:00
parent eb275e34a0
commit afa800dfaf
23 changed files with 25 additions and 99 deletions
+1 -3
View File
@@ -1,7 +1,5 @@
set_project("libcss")
set_version("0.1.0-a")
target("libcss")
set_version("0.1.0-a")
set_kind("$(kind)")
add_files("src/**.c")
set_configdir("include/css")
+1 -2
View File
@@ -1,8 +1,7 @@
set_project("i18n")
set_version("0.1.0-a")
add_requires("libyaml", { optional = true })
target("libi18n")
set_version("0.1.0-a")
set_kind("$(kind)")
add_files("src/*.c")
add_deps("yutil")
+3 -72
View File
@@ -1,78 +1,9 @@
add_rules("mode.debug", "mode.release")
add_requires("cairo")
target("pandagl_cairo_example")
target("pandagl-cairo-example")
set_default(false)
set_kind("binary")
set_group("examples")
add_files("src/*.c")
add_packages("cairo")
add_deps("pandagl", "yutil")
--
-- If you want to known more usage about xmake, please see https://xmake.io
--
-- ## FAQ
--
-- You can enter the project directory firstly before building project.
--
-- $ cd projectdir
--
-- 1. How to build project?
--
-- $ xmake
--
-- 2. How to configure project?
--
-- $ xmake f -p [macosx|linux|iphoneos ..] -a [x86_64|i386|arm64 ..] -m [debug|release]
--
-- 3. Where is the build output directory?
--
-- The default output directory is `./build` and you can configure the output directory.
--
-- $ xmake f -o outputdir
-- $ xmake
--
-- 4. How to run and debug target after building project?
--
-- $ xmake run [targetname]
-- $ xmake run -d [targetname]
--
-- 5. How to install target to the system directory or other output directory?
--
-- $ xmake install
-- $ xmake install -o installdir
--
-- 6. Add some frequently-used compilation flags in xmake.lua
--
-- @code
-- -- add debug and release modes
-- add_rules("mode.debug", "mode.release")
--
-- -- add macro defination
-- add_defines("NDEBUG", "_GNU_SOURCE=1")
--
-- -- set warning all as error
-- set_warnings("all", "error")
--
-- -- set language: c99, c++11
-- set_languages("c99", "c++11")
--
-- -- set optimization: none, faster, fastest, smallest
-- set_optimize("fastest")
--
-- -- add include search directories
-- add_includedirs("/usr/include", "/usr/local/include")
--
-- -- add link libraries and search directories
-- add_links("tbox")
-- add_linkdirs("/usr/local/lib", "/usr/lib")
--
-- -- add system link libraries
-- add_syslinks("z", "pthread")
--
-- -- add compilation and link flags
-- add_cxflags("-stdnolib", "-fno-strict-aliasing")
-- add_ldflags("-L/usr/local/lib", "-lpthread", {force = true})
--
-- @endcode
--
@@ -1,6 +1,7 @@
target("char-render")
set_default(false)
set_kind("binary")
set_group("examples")
set_rundir("app")
add_deps("pandagl")
add_files("src/*.c")
@@ -1,6 +1,7 @@
target("fill-rect-with-rgba")
set_default(false)
set_kind("binary")
set_group("examples")
set_rundir("app")
add_deps("pandagl")
add_files("src/*.c")
+1
View File
@@ -1,6 +1,7 @@
target("fill-rect")
set_default(false)
set_kind("binary")
set_group("examples")
set_rundir("app")
add_deps("pandagl")
add_files("src/*.c")
@@ -1,6 +1,7 @@
target("image-scaling-bench")
set_default(false)
set_kind("binary")
set_group("examples")
set_rundir("app")
add_deps("pandagl", "yutil")
add_files("src/*.c")
@@ -1,6 +1,7 @@
target("mix-rect-with-opacity")
set_default(false)
set_kind("binary")
set_group("examples")
set_rundir("app")
add_deps("pandagl")
add_files("src/*.c")
@@ -1,6 +1,7 @@
target("paint-background")
set_default(false)
set_kind("binary")
set_group("examples")
set_rundir("app")
add_deps("pandagl")
add_files("src/*.c")
@@ -1,6 +1,7 @@
target("paint-border")
set_default(false)
set_kind("binary")
set_group("examples")
set_rundir("app")
add_deps("pandagl")
add_files("src/*.c")
@@ -1,6 +1,7 @@
target("paint-boxshadow")
set_default(false)
set_kind("binary")
set_group("examples")
set_rundir("app")
add_deps("pandagl")
add_files("src/*.c")
@@ -1,6 +1,7 @@
target("pixel-manipulation")
set_default(false)
set_kind("binary")
set_group("examples")
set_rundir("app")
add_deps("pandagl", "yutil")
add_files("src/*.c")
@@ -1,6 +1,7 @@
target("string-render")
set_default(false)
set_kind("binary")
set_group("examples")
set_rundir("app")
add_deps("pandagl")
add_files("src/*.c")
+1 -2
View File
@@ -1,5 +1,3 @@
set_project("pandagl")
set_version("0.1.0-a")
add_requires("libpng", "libjpeg", {optional = true})
add_requires("freetype", {optional = true, configs = {shared = false}})
@@ -23,6 +21,7 @@ option("with-pandagl-text")
set_configvar("PANDAGL_HAS_TEXT", 1)
target("pandagl")
set_version("0.1.0-a")
set_kind("$(kind)")
add_files("src/*.c")
add_deps("yutil")
+1 -3
View File
@@ -1,7 +1,5 @@
set_project("librouter")
set_version("0.1.0-a")
target("librouter")
set_version("0.1.0-a")
set_kind("$(kind)")
add_files("src/*.c")
add_deps("yutil", "libui")
+1 -2
View File
@@ -1,6 +1,5 @@
set_version("0.1.0-a")
target("libthread")
set_version("0.1.0-a")
set_kind("$(kind)")
add_files("src/*.c")
set_configdir("include")
+1 -3
View File
@@ -1,7 +1,5 @@
set_project("libui-cursor")
set_version("0.1.0-a")
target("libui-cursor")
set_version("0.1.0-a")
set_kind("$(kind)")
add_files("src/**.c")
add_deps("yutil", "pandagl", "libptk")
+1 -3
View File
@@ -1,7 +1,5 @@
set_project("libui-router")
set_version("0.1.0-a")
target("libui-router")
set_version("0.1.0-a")
set_kind("$(kind)")
add_files("src/**.c")
add_deps("yutil", "libui", "librouter")
+1 -2
View File
@@ -1,10 +1,9 @@
set_project("libui-server")
set_version("0.1.0-a")
add_requires("libomp", {optional = true})
option("with-openmp", {showmenu = true, default = true})
target("libui-server")
set_version("0.1.0-a")
set_kind("$(kind)")
add_files("src/**.c")
add_packages("libomp")
+1 -2
View File
@@ -1,8 +1,7 @@
set_project("libui-xml")
set_version("0.1.0-a")
add_requires("libxml2", {optional = true})
target("libui-xml")
set_version("0.1.0-a")
add_packages("libxml2")
if has_package("libxml2") then
set_configvar("LIBUI_XML_HAS_LIBXML2", 1)
+1 -3
View File
@@ -1,7 +1,5 @@
set_project("libui")
set_version("0.1.0-a")
target("libui")
set_version("0.1.0-a")
set_kind("$(kind)")
add_files("src/**.c")
add_deps("yutil", "pandagl", "libcss")
+1 -1
View File
@@ -6,7 +6,7 @@ local previews = {
}
for _, topic in ipairs(previews) do
target("preview_" .. topic)
target("preview-" .. topic:gsub("_", "-"))
set_default(false)
set_kind("binary")
set_group("previews")