UniversalCanCore/xmake.lua
2025-12-24 17:18:34 +08:00

36 lines
1.6 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- xmake.lua
-- UniversalCanCore 构建脚本
-- 设置项目名和版本
set_project("UniversalCanCore")
set_version("1.0.0")
-- 设置 C++17
set_languages("c++17")
-- 定义静态库 target
target("UniversalCanCore")
set_kind("binary") -- 静态库
add_includedirs("Inc") -- 头文件目录
add_includedirs("Packages/asio-1.36.0/include")
add_includedirs("Device/ScHHS/") -- 四川何华盛的can盒子
add_includedirs("Device/ScHHS/Port") -- 四川何华盛的can盒子port
add_files("Device/ScHHS/Port/*.cpp") -- 源文件
add_linkdirs("Device/ScHHS/") -- 链接.lib文件注意只写库名不要扩展名
add_links("HCanbus") -- 假设库文件名为 HCANBus.lib
add_includedirs("Device/Zlg/Port") -- zlg的can盒子
add_files("Device/Zlg/Port/*.cpp") -- 源文件
add_files("Src/*.cpp") -- 源文件
add_links("ws2_32") -- 声明win32
-- 自定义 MinGW 工具链
toolchain("mingw64")
set_kind("standalone") -- 独立工具链,不依赖 PATH
set_toolset("cc", "C:/Applications/Program Custom/msys2/mingw64/bin/gcc.exe")
set_toolset("cxx", "C:/Applications/Program Custom/msys2/mingw64/bin/g++.exe")
set_toolset("ld", "C:/Applications/Program Custom/msys2/mingw64/bin/g++.exe")
set_toolset("ar", "C:/Applications/Program Custom/msys2/mingw64/bin/ar.exe")
-- clear project command "xmake f -c"
-- pre build command "xmake f --toolchain=mingw64"
-- build command "xmake"