Skip to content

Commit 963a5f3

Browse files
authored
Support any number of flags in UVLOOP_OPT_CFLAGS (#630)
Use `shlex.split()` to split the flags in `UVLOOP_OPT_FLAGS`, permitting the user to pass any number of flags rather than exactly one. This can be used e.g. to pass `-O2 -flto`.
1 parent 173e88c commit 963a5f3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import pathlib
1313
import platform
1414
import re
15+
import shlex
1516
import shutil
1617
import subprocess
1718
import sys
@@ -23,7 +24,7 @@
2324

2425
CYTHON_DEPENDENCY = 'Cython~=3.1'
2526
MACHINE = platform.machine()
26-
MODULES_CFLAGS = [os.getenv('UVLOOP_OPT_CFLAGS', '-O2')]
27+
MODULES_CFLAGS = shlex.split(os.getenv('UVLOOP_OPT_CFLAGS', '-O2'))
2728
_ROOT = pathlib.Path(__file__).parent
2829
LIBUV_DIR = str(_ROOT / 'vendor' / 'libuv')
2930
LIBUV_BUILD_DIR = str(_ROOT / 'build' / 'libuv-{}'.format(MACHINE))

0 commit comments

Comments
 (0)