compile
Installation
SKILL.md
如何编译本项目
本项目分为 C++ 部分和 Go 部分。当你修改不同类型文件代码时,请使用不同的编译方法。
C++ 部分编译方法
-
判断是否进行增量编译。如果已有
build目录,并且其中有内容,并且你的修改没有涉及到 CMake 相关文件,那么跳转到第5步进行增量编译。 -
创建编译目录
mkdir -p build
- 进入编译目录
cd build
- 构建 CMake 命令
cmake -DCMAKE_BUILD_TYPE=Debug -DLOGTAIL_VERSION=0.0.1 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
-DCMAKE_CXX_FLAGS="-I/opt/rh/devtoolset-9/root/usr/lib/gcc/x86_64-redhat-linux/9/include -I/opt/logtail -I/opt/logtail_spl" \
-DBUILD_LOGTAIL=ON -DBUILD_LOGTAIL_UT=ON -DWITHOUTGDB=ON -DENABLE_STATIC_LINK_CRT=ON -DWITHSPL=ON ../core
注意其中的几个开关: - BUILD_LOGTAIL:表示编译 LoongCollector 二进制。必选 - BUILD_LOGTAIL_UT:表示编译 LoongCollector 单测。仅当你修改了 LoongCollector 单测时才打开。 - WITHSPL:表示编译 LoongCollector SPL 相关内容。仅当你修改了 LoongCollector SPL 相关文件时才打开。
- 编译
make -sj$(nproc)
Go 部分编译方法
执行
make plugin_local
Related skills
More from alibaba/loongcollector
riper5-protocol
This workflow, known as RIPER-5, is designed exclusively for handling complex software engineering tasks such as system design, architectural refactoring, bug diagnosis, performance optimization, and multi-component integration.
2mermaid
Whenever diagrams or mermaid is mentioned
1commit
Writing Commit Message
1selfmonitor
自监控指标、告警代码标准
1code-review
在进行 Code Review 时,使用这个技能对 LoongCollector 变更进行安全导向、架构一致性优先的深度代码评审。
1