We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc8aefb commit 7d78e50Copy full SHA for 7d78e50
setup.py
@@ -1,4 +1,5 @@
1
import os
2
+import re
3
import subprocess
4
import sys
5
import unittest
@@ -39,10 +40,11 @@ def initialize_options(self):
39
40
def build_libuv(self):
41
env = os.environ.copy()
42
- env['CFLAGS'] = ('-fPIC ' +
43
- env.get('CFLAGS', '-O2') +
44
- ' ' +
45
- env.get('ARCHFLAGS', ''))
+ cur_cflags = env.get('CFLAGS', '')
+ if not re.search('-O\d', cur_cflags):
+ cur_cflags += ' -O2'
46
+
47
+ env['CFLAGS'] = (cur_cflags + ' -fPIC' + env.get('ARCHFLAGS', ''))
48
49
j_flag = '-j{}'.format(os.cpu_count() or 1)
50
0 commit comments