简体   繁体   中英

How I can add 3rd party (C++) dependency to BUCK file?

I build my project with Buck. How can I add external (not Buck) libs to project?

My example BUCK:

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

But is error: BUILD FAILED: //my_proj:my_project: parameter 'deps': cannot coerce 'boost_system' to class com.facebook.buck.model.BuildTarget

Use prebuilt_cxx_library:

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

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

and

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM