Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add duilib_ultimate #5163

Merged
merged 5 commits into from
Sep 8, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions packages/d/duilib_ultimate/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package("duilib_ultimate")

set_homepage("https://github.com/qdtroy/DuiLib_Ultimate")
set_description("DuiLib_Ultimate是duilib库的增强拓展版")
heheda123123 marked this conversation as resolved.
Show resolved Hide resolved

add_urls("https://github.com/qdtroy/DuiLib_Ultimate/archive/refs/tags/$(version).tar.gz")
add_versions("0.3", "4a650267e98d8b19818bdeb7675dcf1403017732b961620678e1d2d81f81db91")

add_configs("shared", {description = "Download shared binaries.", default = false, type = "boolean", readonly=true})
heheda123123 marked this conversation as resolved.
Show resolved Hide resolved
add_configs("vs_runtime", {description = "Set vs compiler runtime.", default = "MT", type = "string", readonly = true})
heheda123123 marked this conversation as resolved.
Show resolved Hide resolved

on_install("windows|!arm64", function (package)
package:add("defines", "UILIB_STATIC")
package:add("syslinks", "gdi32")

io.writefile("add_defines.props", [[
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>
%(PreprocessorDefinitions);UILIB_STATIC
</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
</Project>
]])
local configs = {"DuiLib.sln"}
table.insert(configs, "/p:Configuration=" .. (package:debug() and "SDebug" or "SRelease"))
table.insert(configs, "/p:Platform=" .. (package:is_arch("x64") and "x64" or "Win32"))
table.insert(configs, "-t:DuiLib")
table.insert(configs, '/p:ForceImportBeforeCppTargets="add_defines.props"')
import("package.tools.msbuild").build(package, configs, {upgrade = {"DuiLib.sln"}})
os.cp("Lib/*", package:installdir("lib"))
os.cp("bin", package:installdir())
os.cp ("DuiLib/**.h", package:installdir("include"), {rootdir="DuiLib"})
os.cp ("DuiLib/Utils/Flash11.tlb", package:installdir("include") .. "/Utils/")
os.cp ("DuiLib/Utils/flash11.tlh", package:installdir("include") .. "/Utils/")
end)

on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include "UIlib.h"
using namespace DuiLib;
void test() {
CButtonUI *pButton = new CButtonUI();
}
]]}))
end)
Loading