Skip to content

Commit 2cd6296

Browse files
authored
Use system iwyu and reference libraries
1 parent b45e06c commit 2cd6296

1 file changed

Lines changed: 22 additions & 20 deletions

File tree

.github/workflows/verify-build.yml

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ jobs:
196196
os: ubuntu-latest
197197
build-type: iwyu
198198
compiler-family: clang
199-
c-compiler: clang-9
200-
cc-compiler: clang-9++
199+
c-compiler: clang-7
200+
cc-compiler: clang-7++
201201
debug: nodebug
202202
coverage: nocoverage
203203
steps:
@@ -236,24 +236,24 @@ jobs:
236236

237237
- name: Install IWYU dependencies if needed
238238
run: |
239-
sudo apt-get install cmake llvm-9-dev llvm-9-tools libclang-9-dev clang-9
239+
sudo apt-get install cmake llvm-7-dev llvm-7-tools libclang-7-dev clang-7 iwyu
240240
if: ${{ matrix.build-type == 'iwyu' }}
241241

242242
# Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise.
243-
- name: Install IWYU if requested
244-
run: |
245-
CLANG_ROOT_PATH=`llvm-config-9 --prefix` ;
246-
CLANG_BIN_PATH=`llvm-config-9 --bindir` ;
247-
curl "https://libhttpserver.s3.amazonaws.com/travis_stuff/include-what-you-use-clang-9.tgz" -o "include-what-you-use-clang-9.tgz" ;
248-
tar -xzf "include-what-you-use-clang-9.tgz" ;
249-
cd include-what-you-use ;
250-
mkdir build_iwyu ;
251-
cd build_iwyu ;
252-
cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS=-std=gnu++14 -DCMAKE_PREFIX_PATH=$ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../ ;
253-
make ;
254-
sudo make install ;
255-
cd .. ;
256-
if: ${{ matrix.build-type == 'iwyu' }}
243+
# - name: Install IWYU if requested
244+
# run: |
245+
# CLANG_ROOT_PATH=`llvm-config-9 --prefix` ;
246+
# CLANG_BIN_PATH=`llvm-config-9 --bindir` ;
247+
# curl "https://libhttpserver.s3.amazonaws.com/travis_stuff/include-what-you-use-clang-9.tgz" -o "include-what-you-use-clang-9.tgz" ;
248+
# tar -xzf "include-what-you-use-clang-9.tgz" ;
249+
# cd include-what-you-use ;
250+
# mkdir build_iwyu ;
251+
# cd build_iwyu ;
252+
# cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS=-std=gnu++14 -DCMAKE_PREFIX_PATH=$ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../ ;
253+
# make ;
254+
# sudo make install ;
255+
# cd .. ;
256+
# if: ${{ matrix.build-type == 'iwyu' }}
257257

258258
- name: CURL from cache (for testing)
259259
id: cache-CURL
@@ -351,9 +351,11 @@ jobs:
351351
run: |
352352
cd build ;
353353
if [ "$BUILD_TYPE" = "iwyu" ]; then
354-
clang-9 -print-resource-dir ;
355-
/usr/local/bin/include-what-you-use -print-resource-dir ;
356-
make -k CXX='/usr/local/bin/include-what-you-use -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS" ;
354+
clang-7 -print-resource-dir ;
355+
/usr/bin/include-what-you-use -print-resource-dir ;
356+
sudo ln -s `clang-7 -print-resource dir`/include `/usr/bin/include-what-you-use -print-resource-dir`/include ;
357+
sudo ln -s `clang-7 -print-resource dir`/lib `/usr/bin/include-what-you-use -print-resource-dir`/lib ;
358+
make -k CXX='/usr/bin/include-what-you-use -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS" ;
357359
if [ $? -ne 2 ]; then
358360
return 1;
359361
fi

0 commit comments

Comments
 (0)