@@ -119,36 +119,35 @@ jobs:
119119# if: runner.os == 'Windows'
120120# run: echo "C:\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
121121
122- - name : Add clang path to $PATH env
123- if : runner.os == 'Windows'
124- run : |
125- echo "CC=clang" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
126- echo "CXX=clang++" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
127-
128- - name : Check Clang Version
129- run : clang --version
122+ # - name: Add clang path to $PATH env
123+ # if: runner.os == 'Windows'
124+ # run: |
125+ # echo "CC=clang" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
126+ # echo "CXX=clang++" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
130127
131- - name : Force Clang for Compilation
128+ - name : Install MSYS2
132129 run : |
133- echo "[build]" >> $HOME/.pydistutils.cfg
134- echo "compiler=clang" >> $HOME/.pydistutils.cfg
130+ choco install msys2 --no-progress --yes
131+ refreshenv
135132
136- - name : Ensure cl.exe is Removed
133+ - name : Update MSYS2 and install toolchain
134+ shell : msys2 {0}
137135 run : |
138- cl.exe --version
136+ pacman -Syu --noconfirm
137+ pacman -S --noconfirm --needed mingw-w64-x86_64-gcc
139138
140139 - name : Build wheels for windows
141140 if : runner.os == 'Windows'
142141 run : |
143- $envPath = $env:Path
144- echo $envPath
145- $pathArray = $envPath -split ";"
146- $filteredPaths = $pathArray | Where-Object { $_ -notmatch "Microsoft Visual Studio" }
147- $newPath = ($filteredPaths -join ";").TrimEnd(";")
148- echo $newPath
149- $env:Path = $newPath
150- [System.Environment]::SetEnvironmentVariable("Path", $newPath, "User")
151142 python3 -m cibuildwheel --output-dir wheelhouse
143+ env :
144+ # Make sure to put MinGW64 bin folder first in PATH
145+ CIBW_BEFORE_ALL_WINDOWS : |
146+ set PATH=C:\msys64\mingw64\bin;%PATH%
147+ # Use gcc/g++ from MinGW
148+ CIBW_ENVIRONMENT_WINDOWS : |
149+ CC=gcc
150+ CXX=g++
152151
153152 - name : Build wheels
154153 if : runner.os != 'Windows'
0 commit comments