3

我用 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: parameter 'deps': cannot coerce 'boost_system' to class com.facebook.buck.model.BuildTarget

4

1 回答 1

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",
],
.......
于 2017-10-01T21:32:03.850 回答