cpu.lua 1.09 KB
Newer Older
PanZezhongQY's avatar
PanZezhongQY committed
1
2
target("infiniop-cpu")
    set_kind("static")
PanZezhong's avatar
PanZezhong committed
3
4
    add_deps("infini-utils")
    on_install(function (target) end)
PanZezhongQY's avatar
PanZezhongQY committed
5

6
    set_warnings("all", "error")
7

8
    if is_plat("windows") then
9
        add_cxxflags("/wd4068")
10
        if has_config("omp") then
11
            add_cxxflags("/openmp")
12
13
        end
    else
14
        add_cxflags("-fPIC", "-Wno-unknown-pragmas")
15
        add_cxxflags("-fPIC", "-Wno-unknown-pragmas")
16
        if has_config("omp") then
17
            add_cxxflags("-fopenmp")
18
19
            add_ldflags("-fopenmp")
        end
PanZezhongQY's avatar
PanZezhongQY committed
20
21
22
    end

    set_languages("cxx17")
23
    add_files("../src/infiniop/devices/cpu/*.cc", "../src/infiniop/ops/*/cpu/*.cc", "../src/infiniop/reduce/cpu/*.cc")
24

25
target_end()
26
27
28

target("infinirt-cpu")
    set_kind("static")
PanZezhong's avatar
PanZezhong committed
29
30
    add_deps("infini-utils")
    on_install(function (target) end)
31
32
33
34
35

    set_warnings("all", "error")

    if not is_plat("windows") then
        add_cxflags("-fPIC")
36
        add_cxxflags("-fPIC")
37
38
39
40
41
    end

    set_languages("cxx17")
    add_files("../src/infinirt/cpu/*.cc")
target_end()
42
43
44
45

if has_config("omp") then
    add_requires("openmp")
    add_packages("openmp")
46
end