MCPcopy Create free account
hub / github.com/numpy/numpy / _parse_policy_maxopt

Method _parse_policy_maxopt

numpy/distutils/ccompiler_opt.py:2163–2178  ·  view source on GitHub ↗

append the compiler optimization flags

(self, has_baseline, final_targets, extra_flags)

Source from the content-addressed store, hash-verified

2161 return has_baseline, final_targets, extra_flags
2162
2163 def _parse_policy_maxopt(self, has_baseline, final_targets, extra_flags):
2164 """append the compiler optimization flags"""
2165 if self.cc_has_debug:
2166 self.dist_log("debug mode is detected, policy 'maxopt' is skipped.")
2167 elif self.cc_noopt:
2168 self.dist_log("optimization is disabled, policy 'maxopt' is skipped.")
2169 else:
2170 flags = self.cc_flags["opt"]
2171 if not flags:
2172 self.dist_log(
2173 "current compiler doesn't support optimization flags, "
2174 "policy 'maxopt' is skipped", stderr=True
2175 )
2176 else:
2177 extra_flags += flags
2178 return has_baseline, final_targets, extra_flags
2179
2180 def _parse_policy_werror(self, has_baseline, final_targets, extra_flags):
2181 """force warnings to treated as errors"""

Callers

nothing calls this directly

Calls 1

dist_logMethod · 0.45

Tested by

no test coverage detected