コード例 #1
0
ファイル: cmake.py プロジェクト: taehoon1/qemu
def configure():
    """Configures the cmake project."""

    # Clear out the existing directory.
    if FLAGS.clean:
        if os.path.exists(FLAGS.out):
            logging.info('Clearing out %s', FLAGS.out)
            shutil.rmtree(FLAGS.out)
        if not os.path.exists(FLAGS.out):
            os.makedirs(FLAGS.out)

    # Configure..
    cmake_cmd = [get_cmake(), '-B%s' % FLAGS.out]

    # Setup the right toolchain/compiler configuration.
    cmake_cmd += Toolchain.from_string(FLAGS.target).to_cmd()
    cmake_cmd += Crash.from_string(FLAGS.crash).to_cmd()
    cmake_cmd += BuildConfig.from_string(FLAGS.config).to_cmd()

    # Make darwin and msvc builds have QtWebEngine support for the default
    # build.
    if FLAGS.target == "darwin" or FLAGS.target == "windows":
        FLAGS.qtwebengine = True
    cmake_cmd += ['-DQTWEBENGINE=%s' % FLAGS.qtwebengine]

    if FLAGS.cmake_option:
        flags = ['-D%s' % x for x in FLAGS.cmake_option]
        logging.warn('Dangerously adding the following flags to cmake: %s',
                     flags)
        cmake_cmd += flags

    if FLAGS.sdk_revision:
        sdk_revision = FLAGS.sdk_revision
    else:
        sdk_revision = read_simple_properties(
            os.path.join(get_aosp_root(), 'external', 'qemu',
                         'source.properties'))['Pkg.Revision']
    cmake_cmd += ['-DOPTION_SDK_TOOLS_REVISION=%s' % sdk_revision]

    if FLAGS.sdk_build_number:
        cmake_cmd += [
            '-DOPTION_SDK_TOOLS_BUILD_NUMBER=%s' % FLAGS.sdk_build_number
        ]
    if FLAGS.sanitizer:
        cmake_cmd += ['-DOPTION_ASAN=%s' % (','.join(FLAGS.sanitizer))]

    if FLAGS.minbuild:
        cmake_cmd += ['-DOPTION_MINBUILD=%s' % FLAGS.minbuild]

    if FLAGS.gfxstream:
        cmake_cmd += ['-DGFXSTREAM=%s' % FLAGS.gfxstream]

    cmake_cmd += Generator.from_string(FLAGS.generator).to_cmd()
    cmake_cmd += [get_qemu_root()]

    # Make sure we fixup clang in windows builds
    if platform.system() == 'Windows':
        fixup_windows_clang()

    run(cmake_cmd, FLAGS.out)
コード例 #2
0
import os
import platform
import shutil

from aemu.process import run
from aemu.definitions import Generator, Crash, BuildConfig, Toolchain, get_qemu_root, get_cmake, Make, get_aosp_root, fixup_windows_clang, read_simple_properties
from aemu.run_tests import run_tests
from aemu.distribution import create_distribution

FLAGS = flags.FLAGS
flags.DEFINE_string('sdk_revision', None,
                    '## DEPRECATED ##, it will automatically use the one defined in source.properties')
flags.DEFINE_string('sdk_build_number', None, 'The emulator sdk build number.')
flags.DEFINE_enum('config', 'release', BuildConfig.values(),
                  'Whether we are building a release or debug configuration.')
flags.DEFINE_enum('crash', 'none', Crash.values(),
                  'Which crash server to use or none if you do not want crash uploads.'
                  'enabling this will result in symbol processing and uploading during install.')
flags.DEFINE_string('out', os.path.abspath('objs'),
                    'Use specific output directory.')
flags.DEFINE_string('dist', None, 'Create distribution in directory')
flags.DEFINE_boolean('qtwebengine', False, 'Build with QtWebEngine support')
flags.DEFINE_boolean('tests', True, 'Run all the tests')
flags.DEFINE_list(
    'sanitizer', [], 'List of sanitizers ([address, thread]) to enable in the built binaries.')
flags.DEFINE_enum('generator', 'ninja', Generator.values(),
                  'CMake generator to use.')
flags.DEFINE_enum('target',  platform.system().lower(), Toolchain.values(),
                  'Which platform to target. '
                  'This will attempt to cross compile '
                  'if the target does not match the current platform (%s)' % platform.system().lower())
コード例 #3
0
ファイル: cmake.py プロジェクト: LGWingEmulator/external-qemu
from aemu.process import run
from aemu.definitions import Generator, Crash, BuildConfig, Toolchain, get_qemu_root, get_cmake, Make, get_aosp_root, fixup_windows_clang, read_simple_properties
from aemu.run_tests import run_tests
from aemu.distribution import create_distribution

FLAGS = flags.FLAGS
flags.DEFINE_string(
    'sdk_revision', None,
    '## DEPRECATED ##, it will automatically use the one defined in source.properties'
)
flags.DEFINE_string('sdk_build_number', None, 'The emulator sdk build number.')
flags.DEFINE_enum('config', 'release', BuildConfig.values(),
                  'Whether we are building a release or debug configuration.')
flags.DEFINE_enum(
    'crash', 'none', Crash.values(),
    'Which crash server to use or none if you do not want crash uploads.'
    'enabling this will result in symbol processing and uploading during install.'
)
flags.DEFINE_string('out', os.path.abspath('objs'),
                    'Use specific output directory.')
flags.DEFINE_string('dist', None, 'Create distribution in directory')
flags.DEFINE_boolean('qtwebengine', False, 'Build with QtWebEngine support')
flags.DEFINE_boolean('tests', True, 'Run all the tests')
flags.DEFINE_integer('test_jobs', multiprocessing.cpu_count(),
                     'Specifies  the number of tests to run simultaneously')
flags.DEFINE_list(
    'sanitizer', [],
    'List of sanitizers ([address, thread]) to enable in the built binaries.')
flags.DEFINE_enum('generator', 'ninja', Generator.values(),
                  'CMake generator to use.')
コード例 #4
0
flags.DEFINE_string(
    "sdk_revision",
    None,
    "## DEPRECATED ##, it will automatically use the one defined in source.properties",
)
flags.DEFINE_string("sdk_build_number", None, "The emulator sdk build number.")
flags.DEFINE_enum(
    "config",
    "release",
    list(BuildConfig.values()),
    "Whether we are building a release or debug configuration.",
)
flags.DEFINE_enum(
    "crash",
    "none",
    list(Crash.values()),
    "Which crash server to use or none if you do not want crash uploads."
    "enabling this will result in symbol processing and uploading during install.",
)
flags.DEFINE_string("out", os.path.abspath("objs"),
                    "Use specific output directory.")
flags.DEFINE_string("dist", None, "Create distribution in directory")
flags.DEFINE_boolean("qtwebengine", False, "Build with QtWebEngine support")
flags.DEFINE_boolean("tests", True, "Run all the tests")
flags.DEFINE_integer(
    "test_jobs",
    multiprocessing.cpu_count(),
    "Specifies  the number of tests to run simultaneously",
)
flags.DEFINE_list(
    "sanitizer",