|
17 | 17 | - os: macos-13
|
18 | 18 | image: ""
|
19 | 19 | stdlib: libc++ # no libstdc++ on macOS
|
| 20 | + mapping_file_opt: '-Xiwyu --mapping_file=$(realpath ./macos.imp)' |
20 | 21 | fail-fast: false
|
21 | 22 |
|
22 | 23 | runs-on: ${{ matrix.os }}
|
@@ -99,6 +100,13 @@ jobs:
|
99 | 100 | install-deps: false
|
100 | 101 | cache: true
|
101 | 102 |
|
| 103 | + - name: Build macOS mappings |
| 104 | + run: | |
| 105 | + set -x |
| 106 | +
|
| 107 | + wget https://raw.githubusercontent.com/include-what-you-use/include-what-you-use/master/mapgen/iwyu-mapgen-apple-libc.py |
| 108 | + python3 iwyu-mapgen-apple-libc.py $(xcrun --show-sdk-path)/usr/include > macos.imp |
| 109 | +
|
102 | 110 | - name: Prepare CMake
|
103 | 111 | run: |
|
104 | 112 | # TODO: why does it build dmake in the next step?
|
@@ -126,14 +134,22 @@ jobs:
|
126 | 134 | run: |
|
127 | 135 | # -isystem/usr/lib/clang/17/include
|
128 | 136 | # TODO: remove -stdlib= - it should have been taken from the compilation database
|
129 |
| - 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 |
| 137 | + 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 |
130 | 138 |
|
131 | 139 | - uses: actions/upload-artifact@v4
|
132 | 140 | if: success() || failure()
|
133 | 141 | with:
|
134 | 142 | name: Compilation Database (include-what-you-use - ${{ matrix.os }} ${{ matrix.stdlib }})
|
135 | 143 | path: ./cmake.output/compile_commands.json
|
136 | 144 |
|
| 145 | + - uses: actions/upload-artifact@v4 |
| 146 | + if: ${{ contains(matrix.os, 'macos') && (success() || failure()) }} |
| 147 | + with: |
| 148 | + name: macOS Mappings |
| 149 | + path: | |
| 150 | + ./iwyu-mapgen-apple-libc.py |
| 151 | + ./macos.imp |
| 152 | +
|
137 | 153 | - uses: actions/upload-artifact@v4
|
138 | 154 | if: success() || failure()
|
139 | 155 | with:
|
|
0 commit comments