Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .github/workflows/iwyu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- os: macos-13
image: ""
stdlib: libc++ # no libstdc++ on macOS
mapping_file_opt: '-Xiwyu --mapping_file=$(realpath ./macos.imp)'
fail-fast: false

runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -108,6 +109,13 @@ jobs:
install-deps: false
cache: true

- name: Build macOS mappings
run: |
set -x

wget https://raw.githubusercontent.com/include-what-you-use/include-what-you-use/master/mapgen/iwyu-mapgen-apple-libc.py
python3 iwyu-mapgen-apple-libc.py $(xcrun --show-sdk-path)/usr/include > macos.imp

- name: Prepare CMake
run: |
# TODO: why does it build dmake in the next step?
Expand Down Expand Up @@ -135,14 +143,22 @@ jobs:
run: |
# -isystem/usr/lib/clang/17/include
# TODO: remove -stdlib= - it should have been taken from the compilation database
iwyu_tool -p cmake.output -j $(nproc) -- -w -Xiwyu --max_line_length=1024 -Xiwyu --comment_style=long -Xiwyu --quoted_includes_first -Xiwyu --update_comments -stdlib=${{ matrix.stdlib }} > iwyu.log
iwyu_tool -p cmake.output -j $(nproc) -- -w -Xiwyu --max_line_length=1024 -Xiwyu --comment_style=long -Xiwyu --quoted_includes_first -Xiwyu --update_comments -stdlib=${{ matrix.stdlib }} ${{ matrix.mapping_file_opt }} > iwyu.log

- uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: Compilation Database (include-what-you-use - ${{ matrix.os }} ${{ matrix.stdlib }})
path: ./cmake.output/compile_commands.json

- uses: actions/upload-artifact@v4
if: ${{ contains(matrix.os, 'macos') && (success() || failure()) }}
with:
name: macOS Mappings
path: |
./iwyu-mapgen-apple-libc.py
./macos.imp

- uses: actions/upload-artifact@v4
if: success() || failure()
with:
Expand Down