代码拉取完成,页面将自动刷新
add_rules("mode.debug", "mode.release")
-- add_cxflags("-fstandalone-debug")
add_repositories("private-repo https://gitee.com/SmartSmallBoy/private-xmake-repo.git")
add_moduledirs("xmake_modules")
includes("xmake/toolchain.lua")
includes("provider")
includes("go_pipeline")
includes("common")
-- need 1.9.3
add_requires("jsoncpp", {version = "1.9.4", configs = {shared = false}})
add_requires("protobuf-cpp", {version = "3.6.1", configs = {shared = false}})
-- need 1.79
add_requires("boost", {version = "1.86.0", configs = {shared = false, all = true}})
add_requires("gflags", {configs = {shared = false}})
add_requires("spdlog", {configs = {shared = false, header_only = false}})
-- need 7.61.1
add_requires("libcurl", {version = "8.10.0", configs = {shared = false}})
add_requires("gperftools", {version = "2.14", configs = {shared = false}})
add_requires("leveldb", {configs = {shared = false}})
add_requires("lz4", {version = "1.8.3", configs = {shared = false}})
add_requires("libuuid", {configs = {shared = false}})
add_requires("yaml-cpp", {configs = {shared = false}})
add_requires("libunwind", {configs = {shared = false}})
add_requires("rapidjson", {configs = {shared = false}})
add_requires("zstd", {configs = {shared = false}})
add_requires("re2", {configs = {shared = false}})
add_requires("gtest", {configs = {shared = false}})
add_requires("boundscheck", {version = "v1.1.16", configs = {shared = false}})
add_requires("minizip", {configs = {shared = false}})
add_requires("zlib", {configs = {shared = false}})
option("WITHOUT_SPL")
set_default(true)
set_description("Disable SPL")
set_showmenu(true)
add_defines("__EXCLUDE_SPL__")
option("WITH_CIX")
set_default(true)
set_description("build with cix plugin")
set_showmenu(true)
add_defines("__WITH_CIX__")
option("WITH_UNITTEST")
set_default(false)
set_description("build with unittest")
set_showmenu(true)
if has_config("WITH_CIX") then
includes("cix")
end
if has_config("WITH_UNITTEST") then
includes("unittest")
end
target("loongcollector_files")
set_kind("object")
on_config(function (target)
import("util")
if not os.exists("$(projectdir)/protobuf/sls/sls_logs.pb.cc") then
print("sls not exists, generate sls")
os.exec("$(projectdir)/tools/protoc --proto_path=$(projectdir)/protobuf/sls --cpp_out=$(projectdir)/protobuf/sls sls_logs.proto logtail_buffer_meta.proto metric.proto checkpoint.proto")
end
if not os.exists("$(projectdir)/protobuf/models/log_event.pb.cc") then
print("models not exists, generate models")
os.exec("$(projectdir)/tools/protoc --proto_path=$(projectdir)/protobuf_public/models --cpp_out=$(projectdir)/protobuf/models log_event.proto metric_event.proto span_event.proto pipeline_event_group.proto")
end
if not os.exists("$(projectdir)/protobuf/config_server/v1/agent.pb.cc") then
print("v1 not exists, generate v1")
os.exec("$(projectdir)/tools/protoc --proto_path=$(projectdir)/config_server/protocol/v1 --cpp_out=$(projectdir)/protobuf/config_server/v1 agent.proto")
end
if not os.exists("$(projectdir)/protobuf/config_server/v2/agentV2.pb.cc") then
print("v2 not exists, generate v2")
os.exec("$(projectdir)/tools/protoc --proto_path=$(projectdir)/config_server/protocol/v2 --cpp_out=$(projectdir)/protobuf/config_server/v2 agentV2.proto")
end
util.add_framwork_files(target, false)
util.add_common_files(target, false)
util.add_plugin_files(target, false)
end)
after_clean(function (target)
print("clean protobuf $(projectdir)")
os.run("rm -rf $(projectdir)/protobuf/sls/*.pb.*")
os.run("rm -rf $(projectdir)/protobuf/models/*.pb.*")
os.run("rm -rf $(projectdir)/protobuf/config_server/v1/*.pb.*")
os.run("rm -rf $(projectdir)/protobuf/config_server/v2/*.pb.*")
end)
add_options("WITHOUT_SPL", {public = true})
add_options("WITH_CIX", {public = true})
if has_config("WITH_CIX") then
add_deps("cix")
end
add_includedirs("./", "config", {public = true})
add_deps("provider")
add_cxflags("-Wno-delete-abstract-non-virtual-dtor", "-Wno-defaulted-function-deleted", "-Wno-deprecated-declarations")
target("loongcollector")
set_kind("binary")
add_deps("loongcollector_files")
add_files("logtail.cpp")
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。