Skip to content

Commit 8e813d5

Browse files
committed
use CFLAGS envvar instead of extra_compile_args
1 parent 4206af8 commit 8e813d5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

setup.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,17 @@ def __init__(self, *args, **kwargs):
5151

5252
libraries = []
5353
macros = []
54-
extra_compile_args = []
5554

5655
if sys.platform == "win32":
5756
libraries.append("ws2_32")
5857
macros = [("__LITTLE_ENDIAN__", "1")]
59-
extra_compile_args = ["/std:c++20"]
58+
cflags = os.environ.get("CFLAGS")
59+
cxx20flag = "/std:c++20"
60+
if cflags is None:
61+
cflags = cxx20flag
62+
elif cxx20flag not in cflags:
63+
cflags += " " + cxx20flag
64+
os.environ["CFLAGS"] = cflags
6065

6166
ext_modules = []
6267
if not PYPY and not os.environ.get("MSGPACK_PUREPYTHON"):
@@ -67,7 +72,6 @@ def __init__(self, *args, **kwargs):
6772
libraries=libraries,
6873
include_dirs=["."],
6974
define_macros=macros,
70-
extra_compile_args=extra_compile_args,
7175
)
7276
)
7377
del libraries, macros

0 commit comments

Comments
 (0)