def sanitize(self):
import os.path
if not self.working_dir:
self.working_dir = os.path.curdir
if not self.output_dir:
self.output_dir = os.path.join(self.working_dir, 'build', '')
allowed_types = ['executable', 'library', 'shared']
if self.type not in allowed_types:
# TODO: exceptions?
Style.error('Invalid output type:', self.type)
Style.error('Allowed types:', allowed_types)
self.type = allowed_types[0]
Style.error('Reverting to', self.type)
if not self.executable:
self.executable = os.path.join(self.output_dir, self.name)
if self.type == 'executable':
self.executable = platform.current.as_executable(self.executable)
elif self.type == 'library':
self.executable = platform.current.as_static_library(self.executable)
elif self.type == 'shared':
self.executable = platform.current.as_shared_library(self.executable)
self.working_dir = os.path.realpath(self.working_dir)
self.output_dir = os.path.realpath(self.output_dir)
self.sources.working_directory = Path(self.working_dir)
self._init_hooks()
# Stage hooks
# Create an empty list for each stage
评论列表
文章目录