|
26 | 26 | - os: macos-13 |
27 | 27 | image: "" |
28 | 28 | stdlib: libc++ # no libstdc++ on macOS |
| 29 | + mapping_file_opt: '-Xiwyu --mapping_file=$(realpath ./macos.imp)' |
29 | 30 | fail-fast: false |
30 | 31 |
|
31 | 32 | runs-on: ${{ matrix.os }} |
@@ -108,6 +109,13 @@ jobs: |
108 | 109 | install-deps: false |
109 | 110 | cache: true |
110 | 111 |
|
| 112 | + - name: Build macOS mappings |
| 113 | + run: | |
| 114 | + set -x |
| 115 | +
|
| 116 | + wget https://raw.githubusercontent.com/include-what-you-use/include-what-you-use/master/mapgen/iwyu-mapgen-apple-libc.py |
| 117 | + python3 iwyu-mapgen-apple-libc.py $(xcrun --show-sdk-path)/usr/include > macos.imp |
| 118 | +
|
111 | 119 | - name: Prepare CMake |
112 | 120 | run: | |
113 | 121 | # TODO: why does it build dmake in the next step? |
@@ -135,14 +143,22 @@ jobs: |
135 | 143 | run: | |
136 | 144 | # -isystem/usr/lib/clang/17/include |
137 | 145 | # TODO: remove -stdlib= - it should have been taken from the compilation database |
138 | | - 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 |
| 146 | + 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 |
139 | 147 |
|
140 | 148 | - uses: actions/upload-artifact@v4 |
141 | 149 | if: success() || failure() |
142 | 150 | with: |
143 | 151 | name: Compilation Database (include-what-you-use - ${{ matrix.os }} ${{ matrix.stdlib }}) |
144 | 152 | path: ./cmake.output/compile_commands.json |
145 | 153 |
|
| 154 | + - uses: actions/upload-artifact@v4 |
| 155 | + if: ${{ contains(matrix.os, 'macos') && (success() || failure()) }} |
| 156 | + with: |
| 157 | + name: macOS Mappings |
| 158 | + path: | |
| 159 | + ./iwyu-mapgen-apple-libc.py |
| 160 | + ./macos.imp |
| 161 | +
|
146 | 162 | - uses: actions/upload-artifact@v4 |
147 | 163 | if: success() || failure() |
148 | 164 | with: |
|
0 commit comments