Skip to content

Commit fa5059d

Browse files
committed
Add docstring for add_optional_flags.
And rename to `add_optimization_flags`.
1 parent c266293 commit fa5059d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

setup.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,16 @@ def finalize_options(self):
9595
]
9696
super().finalize_options()
9797

98-
def add_optional_flags(self):
98+
def add_optimization_flags(self):
99+
"""
100+
Add optional optimization flags to extension.
101+
102+
This adds flags for LTO and hidden visibility to both compiled
103+
extensions, and to the environment variables so that vendored libraries
104+
will also use them. If the compiler does not support these flags, then
105+
none are added.
106+
"""
107+
99108
env = os.environ.copy()
100109
if sys.platform == 'win32':
101110
return env
@@ -162,7 +171,7 @@ def build_extensions(self):
162171
except (ValueError, AttributeError):
163172
pass
164173

165-
env = self.add_optional_flags()
174+
env = self.add_optimization_flags()
166175
for package in good_packages:
167176
package.do_custom_build(env)
168177
return super().build_extensions()

0 commit comments

Comments
 (0)