def process_kwargs(self, kwargs, environment):
    super().process_kwargs(kwargs, environment)
    if (not for_android(self.is_cross, self.environment)):
        supports_versioning = True
    else:
        supports_versioning = False
    if supports_versioning:
        if ('version' in kwargs):
            self.ltversion = kwargs['version']
            if (not isinstance(self.ltversion, str)):
                raise InvalidArguments(('Shared library version needs to be a string, not ' + type(self.ltversion).__name__))
            if (not re.fullmatch('[0-9]+(\\.[0-9]+){0,2}', self.ltversion)):
                raise InvalidArguments('Invalid Shared library version "{0}". Must be of the form X.Y.Z where all three are numbers. Y and Z are optional.'.format(self.ltversion))
        if ('soversion' in kwargs):
            self.soversion = kwargs['soversion']
            if isinstance(self.soversion, int):
                self.soversion = str(self.soversion)
            if (not isinstance(self.soversion, str)):
                raise InvalidArguments('Shared library soversion is not a string or integer.')
        elif self.ltversion:
            self.soversion = self.ltversion.split('.')[0]
        if ('darwin_versions' in kwargs):
            self.darwin_versions = self._validate_darwin_versions(kwargs['darwin_versions'])
        elif self.soversion:
            self.darwin_versions = (2 * [self.soversion])
    if ('vs_module_defs' in kwargs):
        path = kwargs['vs_module_defs']
        if hasattr(path, 'held_object'):
            path = path.held_object
        if isinstance(path, str):
            if os.path.isabs(path):
                self.vs_module_defs = File.from_absolute_file(path)
            else:
                self.vs_module_defs = File.from_source_file(environment.source_dir, self.subdir, path)
            self.link_depends.append(self.vs_module_defs)
        elif isinstance(path, File):
            self.vs_module_defs = path
            self.link_depends.append(path)
        elif hasattr(path, 'get_filename'):
            path = File.from_built_file(path.subdir, path.get_filename())
            self.vs_module_defs = path
            self.link_depends.append(path)
        else:
            raise InvalidArguments('Shared library vs_module_defs must be either a string, a file object or a Custom Target')
    if ('rust_crate_type' in kwargs):
        rust_crate_type = kwargs['rust_crate_type']
        if isinstance(rust_crate_type, str):
            self.rust_crate_type = rust_crate_type
        else:
            raise InvalidArguments('Invalid rust_crate_type "{0}": must be a string.'.format(rust_crate_type))
def process_kwargs(self, kwargs, environment):
    super().process_kwargs(kwargs, environment)
    if (not for_android(self.is_cross, self.environment)):
        supports_versioning = True
    else:
        supports_versioning = False
    if supports_versioning:
        if ('version' in kwargs):
            self.ltversion = kwargs['version']
            if (not isinstance(self.ltversion, str)):
                raise InvalidArguments(('Shared library version needs to be a string, not ' + type(self.ltversion).__name__))
            if (not re.fullmatch('[0-9]+(\\.[0-9]+){0,2}', self.ltversion)):
                raise InvalidArguments('Invalid Shared library version "{0}". Must be of the form X.Y.Z where all three are numbers. Y and Z are optional.'.format(self.ltversion))
        if ('soversion' in kwargs):
            self.soversion = kwargs['soversion']
            if isinstance(self.soversion, int):
                self.soversion = str(self.soversion)
            if (not isinstance(self.soversion, str)):
                raise InvalidArguments('Shared library soversion is not a string or integer.')
        elif self.ltversion:
            self.soversion = self.ltversion.split('.')[0]
        if ('darwin_versions' in kwargs):
            self.darwin_versions = self._validate_darwin_versions(kwargs['darwin_versions'])
        elif self.soversion:
            self.darwin_versions = (2 * [self.soversion])
    if ('vs_module_defs' in kwargs):
        path = kwargs['vs_module_defs']
        if hasattr(path, 'held_object'):
            path = path.held_object
        if isinstance(path, str):
            if os.path.isabs(path):
                self.vs_module_defs = File.from_absolute_file(path)
            else:
                self.vs_module_defs = File.from_source_file(environment.source_dir, self.subdir, path)
            self.link_depends.append(self.vs_module_defs)
        elif isinstance(path, File):
            self.vs_module_defs = path
            self.link_depends.append(path)
        elif hasattr(path, 'get_filename'):
            path = File.from_built_file(path.subdir, path.get_filename())
            self.vs_module_defs = path
            self.link_depends.append(path)
        else:
            raise InvalidArguments('Shared library vs_module_defs must be either a string, a file object or a Custom Target')
    if ('rust_crate_type' in kwargs):
        rust_crate_type = kwargs['rust_crate_type']
        if isinstance(rust_crate_type, str):
            self.rust_crate_type = rust_crate_type
        else:
            raise InvalidArguments('Invalid rust_crate_type "{0}": must be a string.'.format(rust_crate_type))