1 Star 0 Fork 1

SmartSmallBoy/loongcollector_cpp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
xmake.lua 4.11 KB
一键复制 编辑 原始数据 按行查看 历史
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")
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/SmartSmallBoy/loongcollector_cpp.git
git@gitee.com:SmartSmallBoy/loongcollector_cpp.git
SmartSmallBoy
loongcollector_cpp
loongcollector_cpp
master

搜索帮助