opencl-clhpp.BUILD 950 字节
Newer Older
L
Liangliang He 已提交
1 2 3 4
licenses(["notice"])

exports_files(["LICENSE.txt"])

5 6 7 8 9 10 11 12 13 14
genrule(
    name = "gen_opencl_clhpp",
    srcs = glob([
      "*",
      "**/*",
    ]),
    outs = ["include/CL/cl.hpp", "include/CL/cl2.hpp"],
    cmd = "workdir=$$(mktemp -d -t opencl-clhpp-build.XXXXXXXXXX); cp -aL $$(dirname $(location CMakeLists.txt))/* $$workdir; pushd $$workdir; mkdir build; pushd build; cmake ../ -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF; make generate_clhpp generate_cl2hpp; popd; popd; cp -a $$workdir/build/* $(@D); rm -rf $$workdir; echo installing to  $(@D)",
)

15 16 17
# The `srcs` is not used in c++ Code, but we need it to trigger the `genrule`,
# So we add the "include/CL/cl.hpp", "include/CL/cl2.hpp" into `srcs`, these
# two files is imported by the `includes` instead of `srcs`.
18 19
cc_library(
    name = "opencl_clhpp",
20 21
    includes = ["include"],
    srcs = ["include/CL/cl.hpp", "include/CL/cl2.hpp"],
22 23
    visibility = ["//visibility:public"],
)