def Main():
    platformBuildTargets = GetPlatformBuildTargets()
    platformEnvironments = GetPlatformEnvironments()
    buildEnvironments = GetBuildEnvironments()

    sourcePlatform = platform.system()
    if not sourcePlatform in platformEnvironments:
        print( "Platform " + sourcePlatform + " not supported as a build platform" )
        return 1

    platformEnv = platformEnvironments[ sourcePlatform ]

    arguments = ParseArguments(platformEnvironments)
    
    customCmakeParams = arguments[ "cmakeParams" ] + " "
    architecture = arguments[ "architecture" ]
    targetConfigs = arguments[ "configs" ]
    installDirectory = arguments[ "installDir" ]
    parallelJobs = arguments[ "parallel" ]
    quotedInstallDirectory = '"' + installDirectory + '"'
    generateClients = arguments[ "generateClients" ]
    sourceDir = arguments["sourcedir" ]
    customMemoryManagement = arguments["customMemoryManagement"]
    enableRtti = arguments["enableRtti"]
    cpuArch = arguments["cpuArchitecture"]
    windowsCpuArch = "intel64"

    if cpuArch == "x86":
        windowsCpuArch = "ia32"

    if os.path.exists( installDirectory ):
        shutil.rmtree( installDirectory )

    if not architecture in platformBuildTargets:
        print( "No definition for target architecture " + architecture )
        return 1

    if architecture == "Linux":
        os.environ["CXX"] = "clang++ -stdlib=libc++"

    targetPlatformDef = platformBuildTargets[ architecture ]
    if not sourcePlatform in targetPlatformDef[ 'buildPlatforms' ]:
        print( "Platform " + sourcePlatform + " does not support building for architecture " + architecture )
        return 1

    buildEnvironment = buildEnvironments[ targetPlatformDef[ 'build_environment' ] ]

    if architecture == 'Android':
       RemoveExternalAndroidDirectories()

    archConfigs = targetPlatformDef[ 'configs' ]

    if generateClients != "0":
        sdk_directories.wipeGeneratedCode()
        customCmakeParams += "-DREGENERATE_CLIENTS=1 "

    if customMemoryManagement == "0":
        customCmakeParams += "-DCUSTOM_MEMORY_MANAGEMENT=0 "
    else:
        customCmakeParams += "-DCUSTOM_MEMORY_MANAGEMENT=1 "

    if enableRtti == "0":
        customCmakeParams += "-DENABLE_RTTI=OFF "
    else:
        customCmakeParams += "-DENABLE_RTTI=ON "

    for targetConfig in targetConfigs:
        if targetConfig in archConfigs:
            archConfig = archConfigs[ targetConfig ]
            buildDirectory = archConfig[ 'directory' ]
            if os.path.exists( buildDirectory ):
                shutil.rmtree( buildDirectory )

            os.mkdir( buildDirectory )
            os.chdir( buildDirectory )
            cmake_call_list = "cmake " + customCmakeParams + " " + archConfig[ 'cmake_params' ] + " " + targetPlatformDef[ 'gen_param' ][cpuArch] + " " + targetPlatformDef[ 'global_cmake_params' ]
            if targetPlatformDef[ 'platform_install_qualifier' ] != "":
                 cmake_call_list = cmake_call_list + " -DPLATFORM_INSTALL_QUALIFIER=" + targetPlatformDef[ 'platform_install_qualifier' ]
 
            cmake_call_list = cmake_call_list + " " + sourceDir
            print( "cmake call = " + cmake_call_list )
            subprocess.check_call( cmake_call_list, shell = True )

            parallelBuildOption = buildEnvironment[ 'parallel_option' ].replace("??", str(parallelJobs))
            build_call_list = buildEnvironment[ 'global_build_call' ] + [ parallelBuildOption ] + archConfig[ 'build_params' ]
            print( "build call = " + str( build_call_list ) )
            subprocess.check_call( build_call_list )

            install_call = "cmake -DCMAKE_INSTALL_CONFIG_NAME=" + archConfig[ 'config' ] + " -DCMAKE_INSTALL_PREFIX=" + quotedInstallDirectory + " -P cmake_install.cmake " + sourceDir
            print( "install call = " + install_call )
            subprocess.check_call( install_call, shell = True )

            # platform specific stuff
        
            # Copy Windows PDBs
            if architecture.startswith('Windows'):
                 CopyPDBs( archConfig[ 'config' ], "bin", installDirectory, targetPlatformDef[ 'platform_install_qualifier' ], windowsCpuArch )

            # Install Android auxiliary dependencies (zlib, openssl, curl)
            if architecture == 'Android':
                CopyAndroidExternalDependencies( archConfig[ 'config' ], installDirectory )

            os.chdir( ".." )

        else:
            print("Build target config " + targetConfig + " does not exist for architecture " + architecture)

    print( "Aws SDK for C++  finished 3rd party installation into: " + installDirectory )
示例#2
0
def Main():
    platformBuildTargets = GetPlatformBuildTargets()
    platformEnvironments = GetPlatformEnvironments()

    sourcePlatform = platform.system()
    if not sourcePlatform in platformEnvironments:
        print("Platform " + sourcePlatform +
              " not supported as a build platform")
        return 1

    platformEnv = platformEnvironments[sourcePlatform]

    arguments = ParseArguments(platformEnvironments)

    customCmakeParams = arguments["cmakeParams"] + " "
    architecture = arguments["architecture"]
    targetConfigs = arguments["configs"]
    installDirectory = arguments["installDir"]
    parallelJobs = arguments["parallel"]
    quotedInstallDirectory = '"' + installDirectory + '"'
    generateClients = arguments["generateClients"]

    if os.path.exists(installDirectory):
        shutil.rmtree(installDirectory)

    if not architecture in platformBuildTargets:
        print("No definition for target architecture " + architecture)
        return 1

    targetPlatformDef = platformBuildTargets[architecture]
    if not sourcePlatform in targetPlatformDef['buildPlatforms']:
        print("Platform " + sourcePlatform +
              " does not support building for architecture " + architecture)
        return 1

    if architecture == 'Android':
        RemoveExternalAndroidDirectories()

    archConfigs = targetPlatformDef['configs']

    if generateClients != "0":
        sdk_directories.wipeGeneratedCode()
        customCmakeParams += "-DREGENERATE_CLIENTS=1 "

    for targetConfig in targetConfigs:
        if targetConfig in archConfigs:
            archConfig = archConfigs[targetConfig]
            buildDirectory = archConfig['directory']
            if os.path.exists(buildDirectory):
                shutil.rmtree(buildDirectory)

            os.mkdir(buildDirectory)
            os.chdir(buildDirectory)

            cmake_call_list = "cmake " + customCmakeParams + " " + archConfig[
                'cmake_params'] + " " + targetPlatformDef[
                    'global_cmake_params'] + " " + ".."
            print("cmake call = " + cmake_call_list)
            subprocess.check_call(cmake_call_list, shell=True)

            parallelBuildOption = platformEnv['parallel_option'].replace(
                "??", str(parallelJobs))
            build_call_list = platformEnv['global_build_call'] + [
                parallelBuildOption
            ] + archConfig['build_params']
            print("build call = " + str(build_call_list))
            subprocess.check_call(build_call_list)

            install_call = "cmake -DCMAKE_INSTALL_CONFIG_NAME=" + archConfig[
                'config'] + " -DCMAKE_INSTALL_PREFIX=" + quotedInstallDirectory + " -P cmake_install.cmake .."
            print("install call = " + install_call)
            subprocess.check_call(install_call, shell=True)

            # platform specific stuff

            # Copy Windows PDBs
            if architecture == 'Windows':
                CopyPDBs(archConfig['config'], "bin", installDirectory)

            # Install Android auxiliary dependencies (zlib, openssl, curl)
            if architecture == 'Android':
                CopyAndroidExternalDependencies(archConfig['config'],
                                                installDirectory)

            os.chdir("..")

        else:
            print("Build target config " + targetConfig +
                  " does not exist for architecture " + architecture)

    print("Aws SDK for C++  finished 3rd party installation into: " +
          installDirectory)
示例#3
0
def Main():
    platformBuildTargets = GetPlatformBuildTargets()
    platformEnvironments = GetPlatformEnvironments()
    buildEnvironments = GetBuildEnvironments()

    sourcePlatform = platform.system()
    if not sourcePlatform in platformEnvironments:
        print("Platform " + sourcePlatform +
              " not supported as a build platform")
        return 1

    platformEnv = platformEnvironments[sourcePlatform]

    arguments = ParseArguments(platformEnvironments)

    customCmakeParams = arguments["cmakeParams"] + " "
    architecture = arguments["architecture"]
    targetConfigs = arguments["configs"]
    installDirectory = arguments["installDir"]
    parallelJobs = arguments["parallel"]
    quotedInstallDirectory = '"' + installDirectory + '"'
    generateClients = arguments["generateClients"]
    sourceDir = arguments["sourcedir"]
    customMemoryManagement = arguments["customMemoryManagement"]
    enableRtti = arguments["enableRtti"]
    cpuArch = arguments["cpuArchitecture"]

    if os.path.exists(installDirectory):
        shutil.rmtree(installDirectory)

    if not architecture in platformBuildTargets:
        print("No definition for target architecture " + architecture)
        return 1

    targetPlatformDef = platformBuildTargets[architecture]
    if not sourcePlatform in targetPlatformDef['buildPlatforms']:
        print("Platform " + sourcePlatform +
              " does not support building for architecture " + architecture)
        return 1

    buildEnvironment = buildEnvironments[
        targetPlatformDef['build_environment']]

    if architecture == 'Android':
        RemoveExternalAndroidDirectories()

    archConfigs = targetPlatformDef['configs']

    if generateClients != "0":
        sdk_directories.wipeGeneratedCode()
        customCmakeParams += "-DREGENERATE_CLIENTS=1 "

    if customMemoryManagement == "0":
        customCmakeParams += "-DCUSTOM_MEMORY_MANAGEMENT=0 "
    else:
        customCmakeParams += "-DCUSTOM_MEMORY_MANAGEMENT=1 "

    if enableRtti == "0":
        customCmakeParams += "-DENABLE_RTTI=OFF "
    else:
        customCmakeParams += "-DENABLE_RTTI=ON "

    for targetConfig in targetConfigs:
        if targetConfig in archConfigs:
            archConfig = archConfigs[targetConfig]
            buildDirectory = archConfig['directory']
            if os.path.exists(buildDirectory):
                shutil.rmtree(buildDirectory)

            os.mkdir(buildDirectory)
            os.chdir(buildDirectory)
            cmake_call_list = "cmake " + customCmakeParams + " " + archConfig[
                'cmake_params'] + " " + targetPlatformDef['gen_param'][
                    cpuArch] + " " + targetPlatformDef['global_cmake_params']
            if targetPlatformDef['platform_install_qualifier'] != "":
                cmake_call_list = cmake_call_list + " -DPLATFORM_INSTALL_QUALIFIER=" + targetPlatformDef[
                    'platform_install_qualifier']

            cmake_call_list = cmake_call_list + " " + sourceDir
            print("cmake call = " + cmake_call_list)
            subprocess.check_call(cmake_call_list, shell=True)

            parallelBuildOption = buildEnvironment['parallel_option'].replace(
                "??", str(parallelJobs))
            build_call_list = buildEnvironment['global_build_call'] + [
                parallelBuildOption
            ] + archConfig['build_params']
            print("build call = " + str(build_call_list))
            subprocess.check_call(build_call_list)

            install_call = "cmake -DCMAKE_INSTALL_CONFIG_NAME=" + archConfig[
                'config'] + " -DCMAKE_INSTALL_PREFIX=" + quotedInstallDirectory + " -P cmake_install.cmake " + sourceDir
            print("install call = " + install_call)
            subprocess.check_call(install_call, shell=True)

            # platform specific stuff

            # Copy Windows PDBs
            if architecture.startswith('Windows'):
                CopyPDBs(archConfig['config'], "bin", installDirectory,
                         targetPlatformDef['platform_install_qualifier'])

            # Install Android auxiliary dependencies (zlib, openssl, curl)
            if architecture == 'Android':
                CopyAndroidExternalDependencies(archConfig['config'],
                                                installDirectory)

            os.chdir("..")

        else:
            print("Build target config " + targetConfig +
                  " does not exist for architecture " + architecture)

    print("Aws SDK for C++  finished 3rd party installation into: " +
          installDirectory)
示例#4
0
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0.
#

import sdk_directories

sdk_directories.wipeGeneratedCode()


示例#5
0
def Main():
    platformBuildTargets = GetPlatformBuildTargets()
    platformEnvironments = GetPlatformEnvironments()

    sourcePlatform = platform.system()
    if not sourcePlatform in platformEnvironments:
        print( "Platform " + sourcePlatform + " not supported as a build platform" )
        return 1

    platformEnv = platformEnvironments[ sourcePlatform ]

    arguments = ParseArguments(platformEnvironments)
    
    customCmakeParams = arguments[ "cmakeParams" ] + " "
    architecture = arguments[ "architecture" ]
    targetConfigs = arguments[ "configs" ]
    installDirectory = arguments[ "installDir" ]
    parallelJobs = arguments[ "parallel" ]
    quotedInstallDirectory = '"' + installDirectory + '"'
    generateClients = arguments[ "generateClients" ]

    if os.path.exists( installDirectory ):
        shutil.rmtree( installDirectory )

    if not architecture in platformBuildTargets:
        print( "No definition for target architecture " + architecture )
        return 1

    targetPlatformDef = platformBuildTargets[ architecture ]
    if not sourcePlatform in targetPlatformDef[ 'buildPlatforms' ]:
        print( "Platform " + sourcePlatform + " does not support building for architecture " + architecture )
        return 1

    if architecture == 'Android':
       RemoveExternalAndroidDirectories()

    archConfigs = targetPlatformDef[ 'configs' ]

    if generateClients != "0":
        sdk_directories.wipeGeneratedCode()
        customCmakeParams += "-DREGENERATE_CLIENTS=1 "

    for targetConfig in targetConfigs:
        if targetConfig in archConfigs:
            archConfig = archConfigs[ targetConfig ]
            buildDirectory = archConfig[ 'directory' ]
            if os.path.exists( buildDirectory ):
                shutil.rmtree( buildDirectory )

            os.mkdir( buildDirectory )
            os.chdir( buildDirectory )

            cmake_call_list = "cmake " + customCmakeParams + " " + archConfig[ 'cmake_params' ] + " " + targetPlatformDef[ 'global_cmake_params' ] + " " + ".."
            print( "cmake call = " + cmake_call_list )
            subprocess.check_call( cmake_call_list, shell = True )

            parallelBuildOption = platformEnv[ 'parallel_option' ].replace("??", str(parallelJobs))
            build_call_list = platformEnv[ 'global_build_call' ] + [ parallelBuildOption ] + archConfig[ 'build_params' ]
            print( "build call = " + str( build_call_list ) )
            subprocess.check_call( build_call_list )

            install_call = "cmake -DCMAKE_INSTALL_CONFIG_NAME=" + archConfig[ 'config' ] + " -DCMAKE_INSTALL_PREFIX=" + quotedInstallDirectory + " -P cmake_install.cmake .."
            print( "install call = " + install_call )
            subprocess.check_call( install_call, shell = True )

            # platform specific stuff
        
            # Copy Windows PDBs
            if architecture == 'Windows':
                CopyPDBs( archConfig[ 'config' ], "bin", installDirectory )

            # Install Android auxiliary dependencies (zlib, openssl, curl)
            if architecture == 'Android':
                CopyAndroidExternalDependencies( archConfig[ 'config' ], installDirectory )

            os.chdir( ".." )

        else:
            print("Build target config " + targetConfig + " does not exist for architecture " + architecture)

    print( "Aws SDK for C++  finished 3rd party installation into: " + installDirectory )
#
# Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
#  http://aws.amazon.com/apache2.0
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
#

import sdk_directories

sdk_directories.wipeGeneratedCode()