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