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)
def main(argv=None): del argv # Unused. version = sys.version_info logging.info( "Running under Python {0[0]}.{0[1]}.{0[2]}, Platform: {1}".format( version, platform.platform())) configure() if FLAGS.build == "config": print("You can now build with: %s " % " ".join(get_build_cmd())) return # Build run(get_build_cmd()) # Test. if FLAGS.tests: cross_compile = platform.system().lower() != FLAGS.target if not cross_compile: run_tests_opts = [] if FLAGS.gfxstream or FLAGS.crosvm or FLAGS.gfxstream_only: run_tests_opts.append("--skip-emulator-check") run_tests(FLAGS.out, FLAGS.test_jobs, FLAGS.crash != "none", run_tests_opts) else: logging.info("Not running tests for cross compile.") # Create a distribution if needed. if FLAGS.dist: data = { "aosp": get_aosp_root(), "target": FLAGS.target, "sdk_build_number": FLAGS.sdk_build_number, "config": FLAGS.config, } create_distribution(FLAGS.dist, FLAGS.out, data) if platform.system() != "Windows" and FLAGS.config == "debug": overrides = open( os.path.join(get_qemu_root(), "android", "asan_overrides")).read() print("Debug build enabled.") print( "ASAN may be in use; recommend disabling some ASAN checks as build is not" ) print("universally ASANified. This can be done with") print() print(". android/envsetup.sh") print("") print("or export ASAN_OPTIONS=%s" % overrides)
def main(argv=None): del argv # Unused. version = sys.version_info logging.info( 'Running under Python {0[0]}.{0[1]}.{0[2]}, Platform: {1}'.format( version, platform.platform())) configure() if FLAGS.build == 'config': print('You can now build with: %s ' % ' '.join(get_build_cmd())) return # Build run(get_build_cmd()) # Test. if FLAGS.tests: cross_compile = platform.system().lower() != FLAGS.target if not cross_compile: run_tests(FLAGS.out, FLAGS.test_jobs) else: logging.info("Not running tests for cross compile.") # Create a distribution if needed. if FLAGS.dist: data = { 'aosp': get_aosp_root(), 'target': FLAGS.target, 'sdk_build_number': FLAGS.sdk_build_number, 'config': FLAGS.config } create_distribution(FLAGS.dist, FLAGS.out, data) if platform.system() != 'Windows' and FLAGS.config == 'debug': overrides = open( os.path.join(get_qemu_root(), 'android', 'asan_overrides')).read() print("Debug build enabled.") print( "ASAN may be in use; recommend disabling some ASAN checks as build is not" ) print("universally ASANified. This can be done with") print() print(". android/envsetup.sh") print("") print("or export ASAN_OPTIONS=%s" % overrides)