加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
xmake.lua 1.78 KB
一键复制 编辑 原始数据 按行查看 历史
nidielaila 提交于 2024-03-09 00:39 . setup xmake build
-- add_syslinks("glfw", "glm")
target("vulkan_test")
set_strip("all")
set_targetdir("./bin")
-- I Use clang on macos, You define your tools
add_cxxflags("clang::-Wc++11-long-long","clang::-Wc++11-extensions","clang::-fno-autolink")
set_languages(cxx17)
set_kind("binary")
add_files("*.cpp")
-- Define your path to `include dir` and `lib dir`
add_includedirs("/Volumes/MacOsData/usr/Cellar/glfw/3.4/include")
add_includedirs("/Volumes/MacOsData/usr/Cellar/glm/1.0.1/include")
add_includedirs("/Volumes/MacOsData/tmp/vulkan-sdk/macOS/include")
add_linkdirs("/Volumes/MacOsData/tmp/vulkan-sdk/macOS/lib")
add_linkdirs("/Volumes/MacOsData/usr/Cellar/glfw/3.4/lib")
-- check `lib dir` and see if there has like `libvulkan.dylib`, and then put `vulkan` to add_links(<here>)
add_links("glfw", "vulkan")
-- on_build(function (target)
-- print("[BUILDING target]: [vulkan_test]")
-- end)
-- after_build(function (target)
-- -- I do not know ldid doing what
-- -- os.run("ldid -S %s", target:targetfile())
-- end)
-- Define yourself
on_clean(function (target)
-- Delete only target files
os.rm(target:targetfile())
os.run("rm -rf bin build")
end)
-- Set up a custom installation script to automatically install apk files
on_install(function (target)
-- Use adb to install packaged apk files
os.run("install -m 755 bin/vulkan_test /Users/mutou/SubOs/usr/bin/vulkan_test")
end)
-- Define your command
on_uninstall(function (target)
os.run("rm -rf /Users/mutou/SubOs/usr/bin/vulkan_test")
end)
target_end()
-- WHEN I CONFIG SOME FUNCS LIKE `on_build, ...`, it may cause typing `xmake` to build but nothing happend, YET I do not know why
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化