{"id":299324,"date":"2020-02-26T21:00:21","date_gmt":"2020-02-26T21:00:21","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=299324"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-02-26T21:00:21","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=299324","title":{"rendered":"\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c C++ \u0441 bazel"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/489566\/\">\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0438 \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u044f<\/h3>\n<p>  \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u044b \u043f\u0440\u043e \u0442\u043e, \u0447\u0442\u043e cmake \u0438 c++ \u2014 \u0434\u0440\u0443\u0437\u044c\u044f, \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u043a\u0430\u043a \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c header-only \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e, \u043d\u043e \u043d\u0435\u0442 \u043e\u0431\u0437\u043e\u0440\u0430 \u0445\u043e\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043d\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0438 \u2014 bazel, buck, gn \u0438 \u0434\u0440\u0443\u0433\u0438\u0445. \u0415\u0441\u043b\u0438 \u0432\u044b, \u043a\u0430\u043a \u0438 \u044f, \u043f\u0438\u0448\u0435\u0442\u0435 \u043d\u0430 C++ \u0432 20\u043a20, \u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u043c \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 bazel \u043a\u0430\u043a \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 c++ \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  \u041e\u0441\u0442\u0430\u0432\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0447\u0435\u043c \u043f\u043b\u043e\u0445\u0438 cmake \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0438 \u0441\u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0430\u043c bazel. \u0420\u0435\u0448\u0430\u0442\u044c, \u0447\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0434\u043b\u044f \u0432\u0430\u0441, \u044f \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0432\u0430\u043c.<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438 \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u0438. Bazel \u044d\u0442\u043e \u043c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0442 \u0433\u0443\u0433\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043c\u0435\u0435\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c c++ \u043f\u0440\u043e\u0435\u043a\u0442\u044b. \u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0432\u043e\u043e\u0431\u0449\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u0431\u043e\u0440\u043a\u0438? \u0412\u043e \u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0435\u0439 \u0443\u0436\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 Tensorflow, Kubernetes \u0438 Gtest, \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0438\u043c\u0438 \u0443\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f bazel. \u0412\u043e \u0432\u0442\u043e\u0440\u044b\u0445, \u043a\u0440\u043e\u043c\u0435 \u0433\u0443\u0433\u043b\u0430 bazel \u0435\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 spaceX, nvidia \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0441\u0443\u0434\u044f \u043f\u043e \u0438\u0445 \u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f\u043c \u043d\u0430 bazelcon. \u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, bazel \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 open-source \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 github, \u0442\u0430\u043a \u0447\u0442\u043e \u043e\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0430 \u043d\u0435\u0433\u043e \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 1. \u0422\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u0439<\/h3>\n<p>  \u0415\u0441\u0442\u044c main.cc \u0438 \u043d\u0430\u0434\u043e \u0435\u0433\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c:<\/p>\n<p>  main.cc<\/p>\n<pre><code class=\"cpp\">#include &lt;iostream&gt;  int main() {    std::cout &lt;&lt; &quot;Hello, habr&quot; &lt;&lt; std::endl;    return 0; } <\/code><\/pre>\n<p>  \u041d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u0441 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f workspace. \u0412 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 bazel workspace \u044d\u0442\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043b\u0435\u0436\u0430\u0442 \u0432\u0441\u0435 \u0432\u0430\u0448\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0442 workspace \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u043d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0443\u0441\u0442\u043e\u0439 \u0444\u0430\u0439\u043b \u0441 \u0438\u043c\u0435\u043d\u0435\u043c WORKSPACE \u0432 \u043d\u0443\u0436\u043d\u043e\u0439 \u043d\u0430\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u043e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f src.<\/p>\n<p>  \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u0435\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u0432 bazel \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u043a\u0435\u0442. \u041f\u0430\u043a\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0435\u0439 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438 \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c BUILD \u0444\u0430\u0439\u043b\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u044d\u0442\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0430\u043a\u0435\u0442 main \u0432 \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wq\/dq\/7l\/wqdq7lk5ecrf91hqc2u7og0y3do.png\"><\/p>\n<p>  \u0412 BUILD \u0444\u0430\u0439\u043b\u0435 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e main. \u041c\u044b, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0442\u0430\u043a \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e cc_binary. Bazel \u0443\u0436\u0435 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 C++, \u0442\u0430\u043a \u0447\u0442\u043e \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043f\u0440\u0430\u0432\u0438\u043b \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 c++ \u0446\u0435\u043b\u0435\u0439, \u0441 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e cc_binary \u0432 BUILD \u0444\u0430\u0439\u043b, \u0443 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u0438\u043c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443. \u0412\u0441\u0435 \u044d\u0442\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 starlark, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0440\u0435\u0437\u0430\u043d\u043d\u044b\u043c \u043f\u0438\u0442\u043e\u043d\u043e\u043c.<\/p>\n<pre><code class=\"python\">cc_binary(   name = &quot;hello_world&quot;,   srcs = &quot;main.cc&quot; ) <\/code><\/pre>\n<p>  Bazel, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 cmake \u043d\u0435 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0445, \u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0430\u0432\u0438\u043b\u0430. \u041f\u043e \u0441\u0443\u0442\u0438, \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0438\u0445 bazel \u0441\u0442\u0440\u043e\u0438\u0442 \u0433\u0440\u0430\u0444 \u043a\u043e\u043c\u0430\u043d\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0442\u0435\u043c \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u0442 \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0444\u0430\u0439\u043b main.c\u0441 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438\u0438, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442 hello_world \u2014 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0430\u0448 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0441 workspace \u0438 \u043d\u0430\u0431\u0440\u0430\u0442\u044c:<\/p>\n<pre><code class=\"bash\">bazel build \/\/main:hello_world <\/code><\/pre>\n<p>  \u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 build \u0438 \u043f\u0443\u0442\u044c \u0434\u043e \u043d\u0430\u0448\u0435\u0439 \u0446\u0435\u043b\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u043e\u0442 \u043a\u043e\u0440\u043d\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432 bazel-bin\/main\/hello_world.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 2. \u0421\u0431\u043e\u0440\u043a\u0430 \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439<\/h3>\n<p>  \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043e\u0441\u043e\u0431\u043e \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b, \u0442\u0430\u043a \u0447\u0442\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432 \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0438 \u043b\u0438\u043d\u043a\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0430\u0448\u0438\u043c main.<\/p>\n<p>  \u041f\u0443\u0441\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 Square, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0435 \u0434\u0432\u0443\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442. \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430, \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e \u0442\u0430\u043a\u0436\u0435 square.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kv\/kr\/0o\/kvkr0o7nryy4fddsibmtge2dabo.png\"><\/p>\n<p>  square.h<\/p>\n<pre><code class=\"cpp\">#ifndef SQUQRE_SQUARE_H_ #define SQUQRE_SQUARE_H_  int Square(int x);  #endif \/\/ SQUQRE_SQUARE_H_ <\/code><\/pre>\n<p>  square.cc  <\/p>\n<pre><code class=\"cpp\">#include &quot;square\/square.h&quot;  int Square(int x) {   return x * x; } <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u044f \u0434\u0435\u043b\u0430\u044e \u044d\u0442\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u0443\u0442\u044c \u043e\u0442 workspace, \u0434\u0430\u0436\u0435 \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0444\u0430\u0439\u043b \u043b\u0435\u0436\u0438\u0442 \u0432 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0430\u043c\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0438\u043d\u044f\u0442 \u0432 chromium code style guide, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 google c++ style guide. \u0422\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0442\u043a\u0443\u0434\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. \u041d\u0435 \u0432\u043e\u043b\u043d\u0443\u0439\u0442\u0435\u0441\u044c, \u0444\u0430\u0439\u043b \u043d\u0430\u0439\u0434\u0435\u0442\u0441\u044f, bazel \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u043f\u0443\u0442\u0438 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u0430 \u0432\u043e\u0442 \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u0442\u0435 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0430\u0432\u0438\u043b\u0443, \u0442\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043c\u043e\u0433\u0443\u0442 \u0438 \u043d\u0435 \u043d\u0430\u0439\u0442\u0438\u0441\u044c \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 bazel\u2019\u043e\u043c.<\/p>\n<p>  \u0412 BUILD \u0444\u0430\u0439\u043b\u0435 \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a cc_library:<\/p>\n<pre><code class=\"python\">cc_library(   name = &quot;square&quot;,   srcs = [&quot;square.cc&quot;],   hdrs = [&quot;square.h&quot;],   visibility = [&quot;\/\/visibility:public&quot;] ) <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u043c\u044b \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 public. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0433\u0434\u0435 \u0443\u0433\u043e\u0434\u043d\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435.<\/p>\n<p>  \u0412 main.cc \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u0430\u0448\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443:<\/p>\n<pre><code class=\"cpp\">#include &lt;iostream&gt; #include &quot;square\/square.h&quot;  int main() {   std::cout &lt;&lt; &quot;Hello, bazel!&quot; &lt;&lt; std::endl;   std::cout &lt;&lt; Square(2) &lt;&lt; std::endl;   return 0; } <\/code><\/pre>\n<p>  \u041e\u043f\u044f\u0442\u044c \u043e\u0431\u0440\u0430\u0449\u0430\u044e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 \u043f\u0443\u0442\u044c \u043e\u0442 workspace. \u0422\u0443\u0442 \u0443\u0436\u0435 \u044d\u0442\u043e \u0442\u043e\u0447\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e bazel \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043b\u0438\u043d\u0443\u043a\u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0433\u0435\u0440\u043c\u0435\u0442\u0438\u0447\u043d\u043e\u0441\u0442\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043e\u043d \u043f\u043e\u0434\u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 square \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0447\u0435\u0440\u0435\u0437 \u043f\u0443\u0442\u044c \u043e\u0442 workspace.<\/p>\n<p>  \u0418 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u0434\u043b\u044f main \u043e\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 square.<\/p>\n<pre><code class=\"python\">cc_binary(   name = &quot;hello_world&quot;,   srcs = [&quot;main.cc&quot;],   deps = [&quot;\/\/square:square&quot;] ) <\/code><\/pre>\n<p>  \u0421\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u044f \u043d\u0430\u0448\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0436\u0435, \u043a\u0430\u043a \u0438 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, bazel \u0441\u0430\u043c \u043f\u043e\u0439\u043c\u0435\u0442 \u0447\u0442\u043e \u043e\u0442 \u0447\u0435\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442, \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442 \u0433\u0440\u0430\u0444, \u0437\u0430\u043a\u0435\u0448\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0438 \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0435\u0440\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0440\u0430\u0442\u044c.<\/p>\n<pre><code class=\"bash\">bazel build \/\/main:hello_world <\/code><\/pre>\n<p>  <\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 3. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432<\/h3>\n<p>  \u041a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u0436\u0438\u0442\u044c \u0431\u0435\u0437 \u0442\u0435\u0441\u0442\u043e\u0432? \u041d\u0438\u043a\u0430\u043a! \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a bazel GTest, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a \u0441\u043b\u043e\u0432\u0443 \u0443\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u0431\u043e\u0440\u043a\u0443 \u0441 bazel \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c. \u0414\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0432 WORKSPACE \u0444\u0430\u0439\u043b\u0435:<\/p>\n<pre><code class=\"python\">load(&quot;@bazel_tools\/\/tools\/build_defs\/repo:git.bzl&quot;, &quot;git_repository&quot;)  git_repository(   name = &quot;googletest&quot;,   remote = &quot;https:\/\/github.com\/google\/googletest&quot;,   tag = &quot;release-1.8.1&quot; ) <\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u043a\u0430\u043a \u0443 \u0445\u0438\u043f\u0441\u0442\u0435\u0440\u043e\u0432, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u043e git_repository \u0438 \u0443\u043a\u0430\u0437\u0430\u043b\u0438 bazel\u2019\u0443 \u043a\u0430\u043a\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u043a\u0430\u0447\u0430\u0442\u044c.<\/p>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 test \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0442\u0435\u0441\u0442\u044b \u043d\u0430 \u043d\u0430\u0448\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443:<\/p>\n<p>  square_unittest.cc<\/p>\n<pre><code class=\"cpp\">#include &quot;gtest\/gtest.h&quot; #include &quot;square\/square.h&quot;  TEST(SquareTests, Basics) {     EXPECT_EQ(Square(-1), 1);     EXPECT_EQ(Square(1), 1);     EXPECT_EQ(Square(2), 4); } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0441\u0442\u0430\u043b \u0447\u0435\u0440\u0435\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432.<\/p>\n<pre><code class=\"python\">cc_test(   name = &quot;unittests&quot;,   srcs = [&quot;square_unittest.cc&quot;],   deps = [    &quot;\/\/square:square&quot;,    &quot;@googletest\/\/:gtest_main&quot;   ] ) <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u043e\u0442 gtest_main, \u0447\u0442\u043e\u0431\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 gtest \u0441\u0430\u043c\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0430 \u043d\u0430\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043b\u0430\u0443\u043d\u0447\u0435\u0440\u0430.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u0442\u0435\u0441\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">bazel test \/\/test:unittests <\/code><\/pre>\n<p>  Bazel \u0441\u0430\u043c \u0441\u043a\u0430\u0447\u0430\u0435\u0442 \u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442 GTest, \u0441\u043b\u0438\u043d\u043a\u0443\u0435\u0442 \u0432\u0441\u0435 \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u0441\u0430\u043c\u0438 \u0442\u0435\u0441\u0442\u044b.<\/p>\n<p>  \u0423\u043f\u043e\u043c\u044f\u043d\u0443, \u0447\u0442\u043e bazel \u0442\u0430\u043a\u0436\u0435 \u0443\u043c\u0435\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c code coverage:<\/p>\n<pre><code class=\"bash\">bazel coverage \/\/test:unittests <\/code><\/pre>\n<p>  \u0410 \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043b\u0430\u0434\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u044b, \u0442\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0432 debug \u0440\u0435\u0436\u0438\u043c\u0435 \u0441 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">bazel build \/\/test:unittests --compilation_mode=dbg -s <\/code><\/pre>\n<p>  <\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 4. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0443\u043c\u0435\u044e\u0442 \u0432 bazel<\/h3>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u0438\u0440 \u043d\u0435 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u043b\u0438\u0448\u044c bazel, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0443\u043c\u0435\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u0430\u0441\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u041d\u0443 \u0438 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0436\u0435 \u043c\u043d\u0435 \u0432 20\u043a20 \u0441\u0432\u043e\u044e \u0442\u0430\u043a\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438 \u043e\u0442\u0432\u043b\u0435\u043a\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u043e\u043b\u0443\u043c\u0435\u0440\u044b, \u0432\u0440\u043e\u0434\u0435 getops \u0442\u043e\u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0438 \u0442\u0430\u0449\u0438\u0442\u044c boost \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442.<\/p>\n<p>  \u041d\u0435 \u0434\u043b\u044f \u0440\u0435\u043a\u043b\u0430\u043c\u044b \u0440\u0430\u0434\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 CLI11, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u043a\u0440\u043e\u043c\u0435 \u043a\u0440\u043e\u043c\u0435 stl \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 C++11 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441.<\/p>\n<p>  \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u044d\u0442\u043e header-only, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0451 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u043c.<\/p>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0432 WORKSPACE:<\/p>\n<pre><code class=\"python\">load(&quot;@bazel_tools\/\/tools\/build_defs\/repo:http.bzl&quot;, &quot;http_file&quot;)  http_file(   name = &quot;CLI11&quot;,   downloaded_file_path = &quot;CLI11.hpp&quot;,   urls = [&quot;https:\/\/github.com\/CLIUtils\/CLI11\/releases\/download\/v1.9.0\/CLI11.hpp&quot;],   sha256 = &quot;6f0a1d8846ed7fa4c2b66da3eb252aa03d27170258df...&quot;, ) <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e third-party \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0430\u043a\u0435\u0442 CLI11 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043e\u0442 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<pre><code class=\"python\">cc_library(   name = &quot;CLI11&quot;,   hdrs = [&quot;@CLI11\/\/file&quot;],   strip_include_prefix = &quot;\/external\/CLI11\/file&quot;,   include_prefix = &quot;CLI11&quot;,   linkstatic = True,   visibility = [&quot;\/\/visibility:public&quot;], ) <\/code><\/pre>\n<p>  Bazel \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u043f\u043e \u043f\u0443\u0442\u0438 \/external\/CLI11 \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u043f\u0443\u0442\u0438 \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e CLI11\/.<\/p>\n<p>  main.cc<\/p>\n<pre><code class=\"cpp\">#include &lt;iostream&gt;  #include &quot;CLI11\/CLI11.hpp&quot; #include &quot;square\/square.h&quot;  int main() {   std::cout &lt;&lt; &quot;Hello, bazel!&quot; &lt;&lt; std::endl;   std::cout &lt;&lt; Square(2) &lt;&lt; std::endl;   return 0; } <\/code><\/pre>\n<p>  \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 main \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c &quot;\/\/third_party\/CLI11:CLI11&quot; \u0438 \u0432\u0441\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<br \/>  \u041d\u0435 \u0437\u043d\u0430\u044e \u043a\u0430\u043a \u0432\u0430\u043c, \u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043d\u0435\u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0430 c++ \u0432 \u0442\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043c\u0435\u043d\u044f \u0432 \u0432\u043e\u0441\u0442\u043e\u0440\u0433.<\/p>\n<p>  \u0414\u0430, \u0441 header-only \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0432\u044b \u0441\u043a\u0430\u0436\u0435\u0442\u0435 \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u043e \u0441 \u043d\u0435 header-only \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0435\u0449\u0435 \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0441 bazel \u0432\u0441\u0435 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e. \u0412\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0435 \u0435\u0451 \u0447\u0435\u0440\u0435\u0437 http_archive \u0438\u043b\u0438 git_repository \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u0435\u0439 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 BUILD \u0444\u0430\u0439\u043b \u0432 third-party \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e, \u0433\u0434\u0435 \u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0435 \u043a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0430\u0448\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443. Bazel \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 \u043b\u044e\u0431\u043e\u0433\u043e cmd \u0438 \u0434\u0430\u0436\u0435 \u0432\u044b\u0437\u043e\u0432 cmake, \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0430\u0432\u0438\u043b\u043e cmake_external.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 5. \u0421\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f<\/h3>\n<p>  \u041a\u043e\u043c\u0443 \u0432 20\u043a20 \u043d\u0443\u0436\u0435\u043d \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u0433\u043e\u043b\u043e\u043c c++ \u0431\u0435\u0437 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438? \u041e\u0431\u044b\u0447\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0435\u0440\u0444 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438\u043b\u0438 \u0434\u043b\u044f \u0434\u0435\u043f\u043b\u043e\u044f \u0432\u0430\u0448\u0438\u0445 \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u044b \u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u043d\u0430 CI. \u041d\u0443 \u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u043e\u043d\u0438 \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u043d\u0430 \u043f\u0438\u0442\u043e\u043d\u0435.<\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e bazel \u0442\u043e\u0436\u0435 \u0433\u043e\u0434\u0438\u0442\u0441\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u0443\u043c\u0435\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432\u043e \u0432\u0441\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438 \u0438 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u043e\u043b\u044f\u043d\u043a\u0438 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043f\u0438\u0442\u043e\u043d \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430\u0448 main.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0430\u043a\u0435\u0442 perf-tests:<\/p>\n<pre><code class=\"python\">py_binary(   name = &quot;perf_tests&quot;,   srcs = [&quot;perf_tests.py&quot;],   data = [     &quot;\/\/main:hello_world&quot;,   ], ) <\/code><\/pre>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430 hello_world.<\/p>\n<p>  perf_tests.py<\/p>\n<pre><code class=\"python\">import subprocess import time  start_time = time.time() process = subprocess.run(['main\/hello_world, 'param1', ],                          stdout=subprocess.PIPE,                          universal_newlines=True) end_time = time.time() print(&quot;--- %s seconds ---&quot; % (end_time - start_time)) <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430\u0448\u0438 \u0442\u0435\u0441\u0442\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0438\u0448\u0435\u043c:  <\/p>\n<pre><code class=\"bash\">bazel run \/\/perf-tests:perf_tests <\/code><\/pre>\n<p>  <\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438 \u0442\u043e, \u0447\u0435\u0433\u043e \u043d\u0435 \u043a\u043e\u0441\u043d\u0443\u043b\u0438\u0441\u044c<\/h3>\n<p>  \u041c\u044b \u043a\u043e\u0440\u043e\u0442\u043a\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043d\u0430 bazel \u0438 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u043a\u0430\u043a \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445, \u0442\u0430\u043a \u0438 \u0441\u0432\u043e\u0438\u0445. \u041d\u0430 \u043c\u043e\u0439 \u0432\u043a\u0443\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u043e \u0438 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e. \u041d\u0435 \u043d\u0430\u0434\u043e \u0441\u0442\u0440\u0430\u0434\u0430\u0442\u044c \u0438 \u0438\u0441\u043a\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043f\u043e cmake \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0449\u044c \u0438 \u0447\u0438\u0441\u0442\u0438\u0442\u044c CmakeCache.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0442\u043e \u0437\u0430 \u0431\u043e\u0440\u0442\u043e\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e: \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 protocol buffers, \u0441\u0430\u043d\u0438\u0442\u0430\u0439\u0437\u0435\u0440\u044b, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0442\u0443\u043b\u0447\u0435\u0439\u043d\u0430 \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b\/\u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435, \u0438 \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u044f \u0431\u044b\u043b \u0432\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u0435\u043d.<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/489566\/\"> https:\/\/habr.com\/ru\/post\/489566\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/489566\/\">\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0438 \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u044f<\/h3>\n<p>  \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u044b \u043f\u0440\u043e \u0442\u043e, \u0447\u0442\u043e cmake \u0438 c++ \u2014 \u0434\u0440\u0443\u0437\u044c\u044f, \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u043a\u0430\u043a \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c header-only \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e, \u043d\u043e \u043d\u0435\u0442 \u043e\u0431\u0437\u043e\u0440\u0430 \u0445\u043e\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043d\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0438 \u2014 bazel, buck, gn \u0438 \u0434\u0440\u0443\u0433\u0438\u0445. \u0415\u0441\u043b\u0438 \u0432\u044b, \u043a\u0430\u043a \u0438 \u044f, \u043f\u0438\u0448\u0435\u0442\u0435 \u043d\u0430 C++ \u0432 20\u043a20, \u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u043c \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 bazel \u043a\u0430\u043a \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 c++ \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  \u041e\u0441\u0442\u0430\u0432\u0438\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0447\u0435\u043c \u043f\u043b\u043e\u0445\u0438 cmake \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0438 \u0441\u043a\u043e\u043d\u0446\u0435\u043d\u0442\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0430\u043c bazel. \u0420\u0435\u0448\u0430\u0442\u044c, \u0447\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0434\u043b\u044f \u0432\u0430\u0441, \u044f \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0432\u0430\u043c.<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438 \u043c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u0438. Bazel \u044d\u0442\u043e \u043c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043e\u0442 \u0433\u0443\u0433\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u043c\u0435\u0435\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c c++ \u043f\u0440\u043e\u0435\u043a\u0442\u044b. \u041f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0432\u043e\u043e\u0431\u0449\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u0431\u043e\u0440\u043a\u0438? \u0412\u043e \u043f\u0435\u0440\u0432\u044b\u0445, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0435\u0439 \u0443\u0436\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 Tensorflow, Kubernetes \u0438 Gtest, \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043d\u0438\u043c\u0438 \u0443\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f bazel. \u0412\u043e \u0432\u0442\u043e\u0440\u044b\u0445, \u043a\u0440\u043e\u043c\u0435 \u0433\u0443\u0433\u043b\u0430 bazel \u0435\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 spaceX, nvidia \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0441\u0443\u0434\u044f \u043f\u043e \u0438\u0445 \u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f\u043c \u043d\u0430 bazelcon. \u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, bazel \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 open-source \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 github, \u0442\u0430\u043a \u0447\u0442\u043e \u043e\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0430 \u043d\u0435\u0433\u043e \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-299324","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299324","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=299324"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299324\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=299324"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=299324"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=299324"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}