Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use CFLAGS envvar instead of extra_compile_args
  • Loading branch information
methane committed May 4, 2024
commit 8e813d5c0932630b8a7e07ab68a6a8c1b8e4cea5
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,17 @@ def __init__(self, *args, **kwargs):

libraries = []
macros = []
extra_compile_args = []

if sys.platform == "win32":
libraries.append("ws2_32")
macros = [("__LITTLE_ENDIAN__", "1")]
extra_compile_args = ["/std:c++20"]
cflags = os.environ.get("CFLAGS")
cxx20flag = "/std:c++20"
if cflags is None:
cflags = cxx20flag
elif cxx20flag not in cflags:
cflags += " " + cxx20flag
os.environ["CFLAGS"] = cflags

ext_modules = []
if not PYPY and not os.environ.get("MSGPACK_PUREPYTHON"):
Expand All @@ -67,7 +72,6 @@ def __init__(self, *args, **kwargs):
libraries=libraries,
include_dirs=["."],
define_macros=macros,
extra_compile_args=extra_compile_args,
)
)
del libraries, macros
Expand Down