install_headers.py (1175B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\carbon\common\stdlib\distutils\command\install_headers.py 2 __revision__ = '$Id: install_headers.py 82110 2010-06-20 13:38:51Z kristjan.jonsson $' 3 from distutils.core import Command 4 5 class install_headers(Command): 6 description = 'install C/C++ header files' 7 user_options = [('install-dir=', 'd', 'directory to install header files to'), ('force', 'f', 'force installation (overwrite existing files)')] 8 boolean_options = ['force'] 9 10 def initialize_options(self): 11 self.install_dir = None 12 self.force = 0 13 self.outfiles = [] 14 15 def finalize_options(self): 16 self.set_undefined_options('install', ('install_headers', 'install_dir'), ('force', 'force')) 17 18 def run(self): 19 headers = self.distribution.headers 20 if not headers: 21 return 22 self.mkpath(self.install_dir) 23 for header in headers: 24 out, _ = self.copy_file(header, self.install_dir) 25 self.outfiles.append(out) 26 27 def get_inputs(self): 28 return self.distribution.headers or [] 29 30 def get_outputs(self): 31 return self.outfiles