Skip to content

Commit 1a0909d

Browse files
committed
Build: Use C11 for wheel and CI builds.
1 parent 8b3e365 commit 1a0909d

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ env:
2525
LIBICONV_VERSION: "1.18"
2626
LIBXML2_VERSION: "2.14.6"
2727
LIBXSLT_VERSION: "1.1.43"
28-
28+
LXML_CSTD: c11
2929

3030
jobs:
3131
cache_libs:
@@ -313,7 +313,8 @@ jobs:
313313
if: false
314314

315315
env:
316-
CFLAGS: -march=core2 -O3 -flto -std=c11 -fPIC -g -Wall -Wextra
316+
CFLAGS: -march=core2 -O3 -flto -fPIC -g -Wall -Wextra
317+
LXML_CSTD: c11
317318
CCACHE_SLOPPINESS: "pch_defines,time_macros"
318319
CCACHE_COMPRESS: 1
319320
CCACHE_COMPRESSLEVEL: 5

.github/workflows/wheels.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ env:
4343
LIBICONV_VERSION: "1.18"
4444
LIBXML2_VERSION: "2.14.6"
4545
LIBXSLT_VERSION: "1.1.43"
46+
LXML_CSTD: "c11"
4647

4748

4849
jobs:

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["Cython>=3.1.4", "setuptools"]
33

44
[tool.cibuildwheel]
55
build-verbosity = 1
6-
environment = {STATIC_DEPS="true", ZLIB_VERSION = "1.3.1", LIBICONV_VERSION = "1.18", LIBXML2_VERSION = "2.14.6", LIBXSLT_VERSION = "1.1.43"}
6+
environment = {STATIC_DEPS="true", ZLIB_VERSION = "1.3.1", LIBICONV_VERSION = "1.18", LIBXML2_VERSION = "2.14.6", LIBXSLT_VERSION = "1.1.43", LXML_CSTD = "c11"}
77
enable = ["pypy", "cpython-prerelease", "cpython-freethreading"]
88
# "pypy"
99
# "cpython-prerelease"
@@ -50,7 +50,6 @@ environment.AR = "gcc-ar"
5050
environment.NM = "gcc-nm"
5151
environment.RANLIB = "gcc-ranlib"
5252
environment.LDFLAGS = "-fPIC -flto"
53-
environment.STATIC_DEPS = "true"
5453

5554
[[tool.cibuildwheel.overrides]]
5655
select = "*linux_i686"

setupinfo.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ def cflags(static_cflags):
317317
result.append('-w')
318318
if OPTION_DEBUG_GCC:
319319
result.append('-g2')
320+
if OPTION_CSTD:
321+
result.append(f'/std:{OPTION_CSTD}' if sys.platform == 'win32' else f'-std={OPTION_CSTD}')
320322

321323
if OPTION_STATIC:
322324
if not static_cflags:
@@ -558,6 +560,7 @@ def print_deprecated_option(name, new_name):
558560
OPTION_LIBICONV_VERSION = option_value('libiconv-version')
559561
OPTION_ZLIB_VERSION = option_value('zlib-version')
560562
OPTION_MULTICORE = option_value('multicore')
563+
OPTION_CSTD = option_value('lxml-cstd')
561564
OPTION_DOWNLOAD_DIR = option_value('download-dir')
562565
if OPTION_DOWNLOAD_DIR is None:
563566
OPTION_DOWNLOAD_DIR = 'libs'

0 commit comments

Comments
 (0)