I’m using scikit-build-core to build my c++ program on github windows runners. I would like to use gcc instead of microsoft visual studio as the compiler. Below is how I configure compiler settings in my program, but it does not work (see the log, MSVS was used)
Github workflow file
name: build-wheels
on:
push:
branches: [main]
pull_request:
branches: [main, release]
workflow_dispatch:
jobs:
build_wheels:
name: Build wheel for ${{ matrix.buildplat[1] }}
runs-on: ${{ matrix.buildplat[0] }}
strategy:
fail-fast: false
matrix:
buildplat:
- [windows-2022, win_amd64]
python: ["cp38"]
steps:
- uses: actions/checkout@v3
- name: Build wheels for win
if: ${{ contains(matrix.buildplat[1], 'win') }}
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
CIBW_ENVIRONMENT_WINDOWS: >
CC=gcc
CXX=g++
SKBUILD_CMAKE_ARGS="-DCMAKE_C_COMPILER=gcc;-DCMAKE_CXX_COMPILER=g++"
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
pyproject.toml file
[project.urls]
"Source Code" = "https://github.com/jiawlu/OSM2GMNS"
"Bug Tracker" = "https://github.com/jiawlu/OSM2GMNS/issues"
[build-system]
requires = ["scikit-build-core>=0.9.0", "ninja>=1.0"]
build-backend = "scikit_build_core.build"
[project]
name = "osm2gmns"
version = "1.0.0dev1"
requires-python = ">=3.8"
dependencies = []
classifiers = [
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
[tool.scikit-build]
wheel.packages = ["osm2gmns"]
wheel.install-dir = "osm2gmns"
wheel.expand-macos-universal-tags = true
cmake.version = ">=3.25"
cmake.args = ["-DBUILD_OSM2GMNS_EXE=OFF","-DCMAKE_C_COMPILER=gcc","-DCMAKE_CXX_COMPILER=g++"]
cmake.build-type = "Release"
cmake.verbose = true
sdist.include = [
"docs",
"python",
"src"
]
sdist.exclude = [
".github",
".gitattributes",
".gitignore",
"build"
]
[tool.cibuildwheel]
build = "*"
skip = "cp3{6,7}-*"