2017-04-10 114 views
0

我想從Boost.Build遷移到Bazel構建系統。我需要爲正在構建庫的目錄編寫Jamfile。如何爲這個Boost.Build Jamfile寫一個Bazel BUILD文件?

的Jamfile中我已經是

project : usage-requirements <include>$(PROJECT_INSTALL) 
<linkflags>-lboost_system 
; 

lib CommonDataStructures : [ glob *.cpp ] : <link>static ; 

install libCommonDataStructures 
    : CommonDataStructures 
    : <install-type>LIB 
    <variant>release:<location>"$(PROJECT_INSTALL)/lib" 
    <variant>debug:<location>"$(PROJECT_INSTALL)/libdebug" 
    : release debug 
    ; 

我如何寫巴澤勒構建文件?

回答

0

對不起,但我沒有使用Boost.Build的經驗,但我會嘗試。

構建文件將可能僅包含:

cc_library(
    name = "common_data_structures", 
    srcs = glob(["*.cpp"]), 
) 

,並建立它只是運行bazel build //:common_data_structures。 Bazel將產生靜態庫和共享庫,當其他cc_library或cc_binary將依賴它時,它將默認靜態鏈接。看看我們的c++ rules documentation看到所有的屬性。這有幫助嗎?

+0

這根本沒有幫助 –