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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

add simplewindow #4411

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Changes from all 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
48 changes: 48 additions & 0 deletions packages/s/simplewindow/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package("simplewindow")

set_homepage("https://github.com/Mzying2001/sw")
set_description("SimpleWindow GUI Framework")

add_urls("https://github.com/Mzying2001/sw.git")
add_versions("2024.06.20", "894db9de8a43b83f76dca921eeeb372cb7a640b0")

add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})

add_ldflags("/LTCG")
add_shflags("/LTCG")
add_syslinks("user32", "gdi32", "shell32")


on_install("windows|!arm*", function (package)
local configs = {"vs/sw.sln"}
table.insert(configs, "/p:Platform=" .. (package:is_arch("x64") and "x64" or "Win32"))

local vs_runtime = package:runtimes()
local profilename
if vs_runtime == "MT" then
if package:debug() then
table.insert(configs, "/p:Configuration=" .. "Debug_MT")
profilename = "Debug_MT"
else
table.insert(configs, "/p:Configuration=" .. "Release_MT")
profilename = "Release_MT"
end
else
table.insert(configs, "/p:Configuration=" .. (package:debug() and "Debug" or "Release"))
end

import("package.tools.msbuild").build(package, configs)
os.mkdir(package:installdir("include") .. "/sw")
os.cp("sw/inc/*.h", package:installdir("include") .. "/sw")

local outputdir = path.join("vs", "bin", package:is_arch("x64") and "x64" or "Win32", profilename)
os.cp(outputdir .. "/*", package:installdir("lib"))
end)

on_test(function (package)
assert(package:check_cxxsnippets({test = [[
void test() {
sw::Window mainWindow;
}
]]}, {includes = "sw/SimpleWindow.h"}))
end)
Loading