Beispiel #1
0
    def __init__(self, buildDir: Optional[str], generatorName: Optional[str], installPrefix: Optional[str],) -> None:
        super().__init__()

        if buildDir is not None:
            PathUtil.ValidateIsNormalizedPath(buildDir, "BuildDir")
        if installPrefix is not None:
            PathUtil.ValidateIsNormalizedPath(installPrefix, "DefaultInstallPrefix")

        self.BuildDir = buildDir
        self.GeneratorName = generatorName
        self.InstallPrefix = installPrefix
Beispiel #2
0
    def __init__(self, buildDir: str, generatorName: str,
                 installPrefix: Optional[str],
                 cmakeVersion: CMakeVersion) -> None:
        super().__init__()

        PathUtil.ValidateIsNormalizedPath(buildDir, "BuildDir")
        if installPrefix is not None:
            PathUtil.ValidateIsNormalizedPath(installPrefix,
                                              "DefaultInstallPrefix")

        self.BuildDir = buildDir
        self.GeneratorName = generatorName
        self.InstallPrefix = installPrefix
        self.CMakeVersion = cmakeVersion
    def __init__(self,
                 basicConfig: BasicConfig,
                 rootDirs: Optional[List[ToolConfigRootDirectory]],
                 basedUponXML: XmlConfigPackageLocation,
                 projectRootDirectory: Optional[str],
                 resolvedPath: Optional[str] = None) -> None:
        super().__init__()
        if rootDirs is None or projectRootDirectory is None:
            if rootDirs is not None or projectRootDirectory is not None:
                raise Exception(
                    "When rootDirs is none, then the projectRootDirectory must be none"
                )

        # Do some basic validation of the path
        PathUtil.ValidateIsNormalizedPath(basedUponXML.Name, "Location")

        self.BasedOn = basedUponXML
        self.Id = basedUponXML.Id
        self.Name = basedUponXML.Name

        if resolvedPath is not None:
            self.ResolvedPath = IOUtil.NormalizePath(resolvedPath)
        else:
            if rootDirs is None or projectRootDirectory is None:
                raise Exception(
                    "When resolvedPath is None then rootDirs and projectRootDirectory can not be None"
                )
            self.ResolvedPath = self.__ResolvePath(basicConfig, rootDirs,
                                                   self.Name,
                                                   projectRootDirectory)
        self.ResolvedPathEx = "{0}/".format(
            self.ResolvedPath) if len(self.ResolvedPath) > 0 else ""
        self.ScanMethod = basedUponXML.ScanMethod
    def __init__(self, buildDir: Optional[str], generatorName: Optional[str],
                 installPrefix: Optional[str],
                 configUserAppArgs: Optional[str],
                 configGlobalArgs: Optional[str],
                 allowFindPackage: Optional[bool]) -> None:
        super().__init__()

        if buildDir is not None:
            PathUtil.ValidateIsNormalizedPath(buildDir, "BuildDir")
        if installPrefix is not None:
            PathUtil.ValidateIsNormalizedPath(installPrefix,
                                              "DefaultInstallPrefix")

        self.BuildDir = buildDir
        self.GeneratorName = generatorName
        self.InstallPrefix = installPrefix
        self.ConfigAppArgs = "" if configUserAppArgs is None else configUserAppArgs
        self.ConfigGlobalArgs = "" if configGlobalArgs is None else configGlobalArgs
        self.AllowFindPackage = allowFindPackage
    def __init__(self, defaultBuildDir: str,
                 defaultInstallPrefix: Optional[str],
                 minimumVersion: CMakeVersion,
                 platforms: List[CMakeConfigurationPlatform]) -> None:
        super().__init__()

        PathUtil.ValidateIsNormalizedPath(defaultBuildDir, "DefaultBuildDir")
        if defaultInstallPrefix is not None:
            PathUtil.ValidateIsNormalizedPath(defaultInstallPrefix,
                                              "DefaultInstallPrefix")

        self.DefaultBuildDir = defaultBuildDir
        self.DefaultInstallPrefix = defaultInstallPrefix
        self.MinimumVersion = minimumVersion

        platformDict = {}  # type: Dict[str,CMakeConfigurationPlatform]
        for entry in platforms:
            platformDict[entry.Name.lower()] = entry
        self.__PlatformDict = platformDict
Beispiel #6
0
    def __init__(self, name: str, defaultGeneratorName: Optional[str],
                 defaultInstallPrefix: Optional[str]) -> None:
        super().__init__()

        if defaultInstallPrefix is not None:
            PathUtil.ValidateIsNormalizedPath(defaultInstallPrefix,
                                              "DefaultInstallPrefix")

        self.Name = name
        self.DefaultGeneratorName = defaultGeneratorName
        self.DefaultInstallPrefix = defaultInstallPrefix
Beispiel #7
0
    def __init__(self, toolVersion: Version, platformName: str,
                 buildVariantConfig: BuildVariantConfig, buildDir: str,
                 buildDirSetByUser: bool, checkDir: str, generatorName: str,
                 installPrefix: Optional[str], cmakeVersion: CMakeVersion,
                 additionalGlobalConfigArguments: List[str],
                 additionalAppConfigArguments: List[str],
                 allowFindPackage: bool) -> None:
        super().__init__()

        PathUtil.ValidateIsNormalizedPath(buildDir, "BuildDir")
        if installPrefix is not None:
            PathUtil.ValidateIsNormalizedPath(installPrefix,
                                              "DefaultInstallPrefix")

        finalGeneratorName = CMakeHelper.DetermineFinalCMakeGenerator(
            generatorName)
        # its important that we use the  generatorName for the GetCompilerShortIdFromGeneratorName to get the proper android name
        generatorShortName = CMakeHelper.GetCompilerShortIdFromGeneratorName(
            generatorName)

        # Check if we should use a 'build variant temp dir'
        if not buildDirSetByUser:
            buildDir = IOUtil.Join(buildDir, generatorShortName)
            if CMakeHelper.GetGeneratorMultiConfigCapabilities(
                    finalGeneratorName
            ) == CMakeGeneratorMultiConfigCapability.No:
                buildDir = IOUtil.Join(
                    buildDir, BuildVariantConfig.ToString(buildVariantConfig))

        self.ToolVersion = toolVersion
        self.PlatformName = platformName
        self.BuildDir = buildDir
        self.CacheDir = IOUtil.Join(buildDir, '_fsl')
        # If this is true the user specified the directory
        self.BuildDirSetByUser = buildDirSetByUser
        self.CheckDir = checkDir

        # the active build variant
        self.BuildVariantConfig = buildVariantConfig
        self.GeneratorName = generatorName
        self.InstallPrefix = installPrefix
        self.CMakeVersion = cmakeVersion

        self.CMakeCommand = CMakeHelper.DetermineCMakeCommand(platformName)
        # The tool arguments
        self.CMakeInternalArguments = CMakeHelper.DetermineGeneratorArguments(
            finalGeneratorName, platformName)

        # This contains only the user arguments for both recipe and apps
        self.CMakeConfigUserGlobalArguments = additionalGlobalConfigArguments
        self.CMakeConfigUserAppArguments = additionalAppConfigArguments

        # The combined arguments that should be supplied to cmake
        self.CMakeConfigRecipeArguments = self.CMakeInternalArguments + additionalGlobalConfigArguments

        # The combined arguments that should be supplied to cmake
        self.CMakeConfigAppArguments = self.CMakeInternalArguments + additionalGlobalConfigArguments + additionalAppConfigArguments

        self.CMakeFinalGeneratorName = finalGeneratorName
        self.GeneratorShortName = generatorShortName
        self.GeneratorRecipeShortName = "{0}_{1}".format(
            generatorShortName,
            toolVersion.ToMajorMinorString().replace('.', '_'))
        self.AllowFindPackage = allowFindPackage