##// END OF EJS Templates
setup: add flag to build_ext to control building zstd...
Gregory Szorc -
r30450:0acf3fd7 default
parent child Browse files
Show More
@@ -276,7 +276,30 b' class hgdist(Distribution):'
276 # too late for some cases
276 # too late for some cases
277 return not self.pure and Distribution.has_ext_modules(self)
277 return not self.pure and Distribution.has_ext_modules(self)
278
278
279 # This is ugly as a one-liner. So use a variable.
280 buildextnegops = dict(getattr(build_ext, 'negative_options', {}))
281 buildextnegops['no-zstd'] = 'zstd'
282
279 class hgbuildext(build_ext):
283 class hgbuildext(build_ext):
284 user_options = build_ext.user_options + [
285 ('zstd', None, 'compile zstd bindings [default]'),
286 ('no-zstd', None, 'do not compile zstd bindings'),
287 ]
288
289 boolean_options = build_ext.boolean_options + ['zstd']
290 negative_opt = buildextnegops
291
292 def initialize_options(self):
293 self.zstd = True
294 return build_ext.initialize_options(self)
295
296 def build_extensions(self):
297 # Filter out zstd if disabled via argument.
298 if not self.zstd:
299 self.extensions = [e for e in self.extensions
300 if e.name != 'mercurial.zstd']
301
302 return build_ext.build_extensions(self)
280
303
281 def build_extension(self, ext):
304 def build_extension(self, ext):
282 try:
305 try:
General Comments 0
You need to be logged in to leave comments. Login now