1- -- xrepo package definition for EUI-NEO
2- -- https://github.com/sudoevolve/EUI-NEO
3- --
4- -- After submitting this to the xrepo-repo, users can do:
5- -- add_requires("eui-neo")
6- -- target("myapp")
7- -- add_packages("eui-neo")
8- --
9- -- Configurable options:
10- -- add_requires("eui-neo", {configs = {render_backend = "vulkan", window_backend = "glfw"}})
11- -- add_requires("eui-neo", {configs = {shared = true}})
12-
131package (" eui-neo" )
142 set_homepage (" https://github.com/sudoevolve/EUI-NEO" )
153 set_description (" Cross-platform, high-performance, low-overhead C++17 GPUI framework" )
164 set_license (" Apache-2.0" )
175
18- set_urls (" https://github.com/lilyco-42/EUI-NEO.git" )
6+ add_urls (" https://github.com/sudoevolve/EUI-NEO/archive/refs/tags/$(version).tar.gz" ,
7+ " https://github.com/sudoevolve/EUI-NEO.git" )
198
20- add_versions (" v0.5.5" , " df2399495a139a21290bf8a9288f5efba2c52bde " )
9+ add_versions (" v0.5.5" , " cf0da91d7544fe406b704922137fd4d55ed080b3e647501e0ca5303abb00eb98 " )
2110
22- -- Build configuration options (mirror the xmake.lua options)
2311 add_configs (" window_backend" , {description = " Window backend" , default = " glfw" , values = {" glfw" , " sdl2" }})
2412 add_configs (" render_backend" , {description = " Render backend" , default = " opengl" , values = {" auto" , " opengl" , " vulkan" }})
25- add_configs (" shared" , {description = " Build eui_neo as a shared library" , default = false , type = " boolean" })
2613 add_configs (" markdown" , {description = " Enable MD4C Markdown parsing support" , default = true , type = " boolean" })
2714 add_configs (" vulkan_low_latency" , {description = " Prefer low-latency Vulkan presentation" , default = false , type = " boolean" })
2815
29- -- External dependencies resolved by xrepo
16+ add_deps ( " cmake " )
3017 add_deps (" freetype" , " libpng" , " zlib" )
3118
3219 on_load (function (package )
@@ -39,28 +26,31 @@ package("eui-neo")
3926 if package :config (" render_backend" ) == " vulkan" then
4027 package :add (" deps" , " vulkan" )
4128 end
42- if not package :is_plat (" windows" ) then
29+ if not package :is_plat (" windows" , " mingw " ) then
4330 package :add (" deps" , " curl" )
4431 end
4532 end )
4633
4734 on_install (function (package )
48- -- Build EUI-NEO using its own xmake.lua
4935 local configs = {}
50- configs .window_backend = package :config (" window_backend" )
51- configs .render_backend = package :config (" render_backend" )
52- configs .shared = package :config (" shared" )
53- configs .markdown = package :config (" markdown" )
54- configs .vulkan_low_latency = package :config (" vulkan_low_latency" )
55- -- Only build the core library (skip examples/user apps/modules)
56- configs .apps = false
57- configs .user_apps = false
58- import (" package.tools.xmake" ).install (package , configs )
36+ table.insert (configs , " -DEUI_VULKAN_LOW_LATENCY_PRESENT=" .. (package :config (" vulkan_low_latency" ) and " ON" or " OFF" ))
37+ table.insert (configs , " -DEUI_RENDER_BACKEND=" .. package :config (" render_backend" ))
38+ table.insert (configs , " -DEUI_WINDOW_BACKEND=" .. package :config (" window_backend" ))
39+ table.insert (configs , " -DEUI_ENABLE_MARKDOWN=" .. (package :config (" markdown" ) and " ON" or " OFF" ))
40+ table.insert (configs , " -DEUI_BUILD_APPS=OFF" )
41+ table.insert (configs , " -DEUI_BUILD_USER_APPS=OFF" )
42+ table.insert (configs , " -DEUI_ENABLE_INSTALL=ON" )
43+ table.insert (configs , " -DCMAKE_BUILD_TYPE=" .. (package :is_debug () and " Debug" or " Release" ))
44+ table.insert (configs , " -DBUILD_SHARED_LIBS=" .. (package :config (" shared" ) and " ON" or " OFF" ))
45+ table.insert (configs , " -DEUI_BUILD_SHARED=" .. (package :config (" shared" ) and " ON" or " OFF" ))
46+ import (" package.tools.cmake" ).install (package , configs )
5947 end )
6048
61- on_test (function (package )
62- assert (os.isfile (path.join (package :installdir (), " lib" , " eui_neo.lib" ))
63- or os.isfile (path.join (package :installdir (), " lib" , " libeui_neo.a" ))
64- or os.isfile (path.join (package :installdir (), " lib" , " libeui_neo.so" )))
49+ on_test (function (package )
50+ assert (package :check_cxxsnippets ({test = [[
51+ void test() {
52+ eui::Ui ui;
53+ ui.stack("root");
54+ }
55+ ]] }, {configs = {languages = " c++17" }, includes = " eui_neo.h" }))
6556 end )
66- package_end ()
0 commit comments