使用Bazel构建dlib C ++代码

时间:2016-10-20 21:56:37

标签: dlib bazel

使用Bazel构建使用dlib库的C ++代码的最佳方法是什么?即,BUILD规则是什么样的?

我尝试按照answer for OpenCV进行如下操作,但没有运气:

cc_library(
  name = "dlib",
  srcs = glob(["build/dlib/*.so*"]),
  hdrs = glob(["dlib/*.h"]),
  includes = ["include"],
  visibility = ["//visibility:public"], 
  linkstatic = 1,
)

1 个答案:

答案 0 :(得分:0)

我想我明白了。假设dlib已解压缩到/opt/dlib-19.2并内置在/opt/dlib-19.2/build中。

在您的WORKSPACE文件中:

CREATE EVENT History

在dlib.BUILD中:

new_local_repository(
  name = "dlib",
  path = "/opt/dlib-19.2",
  build_file = "dlib.BUILD",
)