summaryrefslogtreecommitdiff
path: root/tests/projects/c++/snippet_runtimes/test.lua
blob: c20ec10ffe6372f9a0cf65baae549bcb550686e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import("lib.detect.find_tool")
import("core.base.semver")
import("utils.ci.is_running", {alias = "ci_is_running"})

function _build()
    if ci_is_running() then
        assert(os.iorun("xmake -rvD"))
    else
        assert(os.iorun("xmake -r"))
    end
end

function main(t)
    local clang = find_tool("clang")
    if clang and not is_subhost("windows") and not is_subhost("bsd", "solaris", "haiku") then
        os.exec("xmake f --toolchain=clang --runtimes=c++_shared --yes")
        _build()
    end
end