如何向BUCK文件添加第三方(C ++)依赖?

时间:2017-10-01 19:33:29

标签: c++ build buck

我和Buck建立了我的项目。如何将外部(不是Buck)库添加到项目中?

我的例子BUCK:

cxx_binary(
    name="my_project",
    srcs=[
         "my_file.cpp",
    ],
    deps=[
        "boost_system",
        "boost_filesystem",
    ],
    compiler_flags=['-w',
                    '-Ddef',
                    '-Ipath',
                    ])

但错误是: BUILD FAILED:// my_proj:my_project:参数' deps':不能强制' boost_system'上课com.facebook.buck.model.BuildTarget

1 个答案:

答案 0 :(得分:1)

使用prebuilt_cxx_library:

prebuilt_cxx_library(
    name="boost_system",
    lib_dir='../otherlibs'
)

prebuilt_cxx_library(
    name="boost_filesystem",
    lib_dir='../otherlibs'
)     

........
deps=[
    ":boost_system",
    ":boost_filesystem",
],
.......