Merge remote-tracking branch 'origin/iwyu' into integration_2024_w41
This commit is contained in:
@@ -76,7 +76,8 @@ openairinterface5g
|
||||
├── openair3 : Layer 3 (3GPP LTE Rel-10 S1AP/GTP, NR Rel-15 NGAP/GTP)
|
||||
├── openshift : OpenShift helm charts for some deployment options of OAI
|
||||
├── radio : Drivers for various radios such as USRP, AW2S, RFsim, 7.2 FHI, ...
|
||||
└── targets : Some configuration files; only historical relevance, and might be deleted in the future
|
||||
├── targets : Some configuration files; only historical relevance, and might be deleted in the future
|
||||
└── tools : Tools for use by the developers/ci machines: code analysis and formatting
|
||||
```
|
||||
|
||||
# How to get support from the OAI Community #
|
||||
|
||||
@@ -115,3 +115,8 @@ The other SDRs (AW2S, LimeSDR, ...) have no READMEs.
|
||||
|
||||
- [UnitTests.md](./UnitTests.md) explains the unit testing setup
|
||||
- [TESTBenches.md](./TESTBenches.md) lists the CI setup and links to pipelines
|
||||
|
||||
# Developer tools
|
||||
|
||||
- [formatting](../tools/formatting/README.md) is a clang-format error detection tool
|
||||
- [iwyu](../tools/iwyu/README.md) is a tool to detect `#include` errors
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# Overview
|
||||
|
||||
IWYU - [include what you use](https://github.com/include-what-you-use/include-what-you-use)
|
||||
is a tool that can detect and correct C/C++ include errors
|
||||
|
||||
# Usage
|
||||
|
||||
```
|
||||
TARGET=<your target> docker compose up
|
||||
```
|
||||
|
||||
Automatically apply suggestions:
|
||||
|
||||
```
|
||||
TARGET=<your target> docker compose run iwyu | tee suggestions
|
||||
cat suggestions | python3 ~/include-what-you-use/fix_includes.py
|
||||
```
|
||||
|
||||
Apply only removal suggestions
|
||||
|
||||
```
|
||||
cat suggestions | grep "should add these line\|The full include-list\|should remove these lines\|^-" | python3 ~/include-what-you-use/fix_includes.py
|
||||
```
|
||||
@@ -0,0 +1,39 @@
|
||||
services:
|
||||
iwyu:
|
||||
image: iwyu
|
||||
build:
|
||||
dockerfile_inline: |
|
||||
FROM ran-base
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt update && \
|
||||
apt install -y wget gnupg && \
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
|
||||
echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main" > /etc/apt/sources.list.d/llvm.list && \
|
||||
apt update
|
||||
RUN apt install -y \
|
||||
git \
|
||||
cmake \
|
||||
build-essential \
|
||||
clang-14 \
|
||||
libclang-14-dev \
|
||||
ninja-build \
|
||||
libyaml-cpp-dev
|
||||
WORKDIR /iwyu/
|
||||
RUN git clone https://github.com/include-what-you-use/include-what-you-use.git
|
||||
RUN cd /iwyu/include-what-you-use && \
|
||||
git checkout origin/clang_14 && \
|
||||
mkdir build && cd build && \
|
||||
cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc ../ -G "Unix Makefiles" && \
|
||||
make
|
||||
RUN apt clean && rm -rf /var/lib/apt/lists/*
|
||||
volumes:
|
||||
- ../../:/code/
|
||||
command:
|
||||
bash -c "git config --global --add safe.directory /code && \
|
||||
mkdir -p iwyu-bin && cd iwyu-bin && \
|
||||
cmake \
|
||||
-DCMAKE_C_INCLUDE_WHAT_YOU_USE=/iwyu/include-what-you-use/build/bin/include-what-you-use \
|
||||
-DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=/iwyu/include-what-you-use/build/bin/include-what-you-use \
|
||||
/code/ \
|
||||
-GNinja && \
|
||||
cmake --build . --target $TARGET"
|
||||
Reference in New Issue
Block a user