examples icon indicating copy to clipboard operation
examples copied to clipboard

how to include new_repository headers

Open wangzy0327 opened this issue 3 years ago • 0 comments

how to include ONEAPI_HEADERS in BUILD file ?

my bazel source file as follow:

ref.bzl
ONEAPI_HEADERS = glob([    "include/**",])
ONEAPI_LIBRARY = glob([    "lib/*",])
cc_import( 
name = "oneAPI", 
 hdrs = ONEAPI_HEADERS,
shared_library = "lib/libsycl.so", 
visibility = ["//visibility:public"],)
BUILD.
cc_binary( 
name = "starter", 
srcs = [ 
 "getting_started.cpp",  
 "example_utils.hpp"   
 ], 
 deps = [  
  "@oneDNN//:oneDNN", 
  "@oneAPI//:oneAPI"
 ],  
  copts = [  
  "-I/home/wzy/sycl_workspace/oneDNN-cuda-debug/include",  
      "-I/home/wzy/sycl_workspace/build-cuda/include",  
      "-I/home/wzy/sycl_workspace/build-cuda/include/sycl",    ],  
 
 linkstatic = 0)

wangzy0327 avatar Jun 28 '22 10:06 wangzy0327