Skip to content
Merged
Show file tree
Hide file tree
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
24 changes: 14 additions & 10 deletions .github/workflows/xmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,32 @@ on:

jobs:
build:
runs-on: windows-latest
runs-on: windows-2025

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: latest
actions-cache-folder: '.xmake-cache'
actions-cache-key: 'ci'
- name: Install LLVM and Clang
uses: std-microblock/install-llvm-action@master
with:
version: "19.1.7"
package-cache: true
package-cache-key: windows-2025
# build-cache: true
# build-cache-key: ${{ matrix.os }}-${{ matrix.build_type }}

- name: Xmake configure
run: |
xmake config --yes --toolchain=clang-cl --mode=releasedbg

- name: build-releasedbg
run: |
xmake f --toolchain=clang-cl -m releasedbg -y --verbose
xmake b -y --verbose inject
xmake b -y --verbose shell

xmake b inject --yes --verbose
xmake b shell --yes --verbose

- name: Upload Artifacts
uses: actions/[email protected]
with:
Expand All @@ -45,6 +48,7 @@ jobs:
run: |
Compress-Archive -Path ./build/windows/* -DestinationPath windows-build-pdb.zip
Remove-Item -Path ./build/windows/x64/releasedbg/*.pdb -Force
Remove-Item -Path ./build/windows/x64/releasedbg/ui.lib -Force
Compress-Archive -Path ./build/windows/* -DestinationPath windows-build.zip

- name: Upload Release Assets
Expand Down
35 changes: 17 additions & 18 deletions dependencies/blook.lua
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
package("blook")
add_deps("cmake")
add_syslinks("advapi32")
set_sourcedir(path.join(os.scriptdir(), "blook"))
on_install(function (package)
local fcdir = package:cachedir() .. "/fetchcontent"
import("package.tools.cmake").install(package, {
"-DCMAKE_INSTALL_PREFIX=" .. package:installdir(),
"-DCMAKE_PREFIX_PATH=" .. package:installdir(),
"-DFETCHCONTENT_QUIET=OFF",
"-DFETCHCONTENT_BASE_DIR=" .. fcdir,
})
os.cp("include/blook/**", package:installdir("include/blook/"))
os.cp("external/zasm/zasm/include/**", package:installdir("include/zasm/"))
os.cp(fcdir .. "/zydis-src/dependencies/zycore/include/**", package:installdir("include/zycore/"))
os.cp(package:buildir() .. "/blook.lib", package:installdir("lib"))
os.cp(package:buildir() .. "/external/zasm/zasm.lib", package:installdir("lib"))
set_description("A modern C++ library for hacking.")
set_license("GPL-3.0")

add_urls("https://github.com/std-microblock/blook.git")

add_versions("2025.03.23", "aab6595fb505b4d11235e7fbceb4d572e95217d6")

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

if is_plat("windows") then
add_syslinks("advapi32")
end

add_deps("zasm edd30ff31d5a1d5f68002a61dca0ebf6e3c10ed0")

on_install("windows", function (package)
import("package.tools.xmake").install(package, {}, {target = "blook"})
end)
package_end()
68 changes: 4 additions & 64 deletions dependencies/glfw.lua
Original file line number Diff line number Diff line change
@@ -1,66 +1,6 @@
package("glfw")
package("breeze-glfw")
set_base("glfw")

set_homepage("https://www.glfw.org/")
set_description("GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan application development.")
set_license("zlib")
set_urls("https://github.com/breeze-shell/glfw.git")

set_sourcedir(path.join(os.scriptdir(), "glfw"))

add_configs("glfw_include", {description = "Choose submodules enabled in glfw", default = "none", type = "string", values = {"none", "vulkan", "glu", "glext", "es2", "es3", "system"}})
add_configs("x11", {description = "Build support for X11", default = is_plat("linux"), type = "boolean"})
add_configs("wayland", {description = "Build support for Wayland", default = false, type = "boolean"})

if is_plat("linux") then
add_extsources("apt::libglfw3-dev", "pacman::glfw-x11")
end

add_deps("cmake")
add_deps("opengl", {optional = true})
if is_plat("macosx") then
add_frameworks("Cocoa", "IOKit")
elseif is_plat("windows") then
add_syslinks("user32", "shell32", "gdi32")
elseif is_plat("mingw", "msys") then
add_syslinks("gdi32")
elseif is_plat("linux") then
add_syslinks("dl", "pthread")
end

on_load(function (package)
local glfw_include = package:config("glfw_include")
if glfw_include ~= "system" then
package:add("defines", "GLFW_INCLUDE_" .. glfw_include:upper())
end
if package:config("x11") then
package:add("deps", "libx11", "libxrandr", "libxrender", "libxinerama", "libxfixes", "libxcursor", "libxi", "libxext")
end
if package:config("wayland") then
package:add("deps", "wayland")
end
end)

on_install("!wasm and !iphoneos", function (package)
local configs = {"-DGLFW_BUILD_DOCS=OFF", "-DGLFW_BUILD_TESTS=OFF", "-DGLFW_BUILD_EXAMPLES=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))

if package:is_plat("windows") then
table.insert(configs, "-DUSE_MSVC_RUNTIME_LIBRARY_DLL=" .. (package:has_runtime("MT") and "OFF" or "ON"))
end
table.insert(configs, "-DGLFW_BUILD_X11=" .. (package:config("x11") and "ON" or "OFF"))
table.insert(configs, "-DGLFW_BUILD_WAYLAND=" .. (package:config("wayland") and "ON" or "OFF"))
if package:is_plat("linux") then
import("package.tools.cmake").install(package, configs, {packagedeps = {"libxrender", "libxfixes", "libxext", "libx11", "wayland"}})
else
import("package.tools.cmake").install(package, configs)
end
end)

on_test(function (package)
assert(package:check_csnippets({test = [[
void test() {
glfwInit();
glfwTerminate();
}
]]}, {configs = {languages = "c11"}, includes = "GLFW/glfw3.h"}))
end)
add_versions("2025.02.16", "07f5b129955039e0f401fc24be41b60e168e0bbb")
7 changes: 5 additions & 2 deletions xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ includes("dependencies/blook.lua")
includes("dependencies/glfw.lua")
includes("dependencies/reflect-cpp.lua")
includes("dependencies/quickjs-ng.lua")
add_requires("blook", "glfw", "nanovg", "glad", "quickjs-ng", "nanosvg", "reflect-cpp")
set_runtimes("MT")

set_runtimes("MT")
add_requires("breeze-glfw", {alias = "glfw"})
add_requires("blook", "nanovg", "glad", "quickjs-ng", "nanosvg", "reflect-cpp")

target("ui")
set_kind("static")
Expand All @@ -30,10 +31,12 @@ target("ui")
set_encodings("utf-8")

target("ui_test")
set_default(false)
set_kind("binary")
add_deps("ui")
add_files("src/ui_test/*.cc")
set_encodings("utf-8")
add_tests("defualt")

target("shell")
set_kind("shared")
Expand Down