-- 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_files("Src/*.cpp")          -- 源文件
    add_links("ws2_32")

-- 自定义 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"