├── .gitattributes
├── .github
└── workflows
│ └── main.yml
├── .gitignore
├── .gitmodules
├── .gn
├── BUILD.gn
├── LICENSE
├── README.md
├── build
├── 3pp_common
│ ├── .style.yapf
│ ├── README.md
│ ├── common.py
│ ├── fetch_github_release.py
│ ├── maven.py
│ ├── print_cipd_version.py
│ └── scripthash.py
├── BUILD.gn
├── DEPS
├── DIR_METADATA
├── OWNERS
├── OWNERS.setnoparent
├── OWNERS.status
├── PRESUBMIT.py
├── PRESUBMIT_test.py
├── README.md
├── action_helpers.py
├── action_helpers_unittest.py
├── add_rts_filters.py
├── apple
│ ├── OWNERS
│ ├── README.md
│ ├── apple_info_plist.gni
│ ├── compile_entitlements.gni
│ ├── compile_plist.gni
│ ├── convert_plist.gni
│ ├── plist_util.py
│ ├── tweak_info_plist.gni
│ ├── tweak_info_plist.py
│ ├── write_pkg_info.py
│ └── xcrun.py
├── args
│ ├── OWNERS
│ ├── README.txt
│ ├── chromeos
│ │ └── README.md
│ └── headless.gn
├── build-ctags.sh
├── build_config.h
├── buildflag.h
├── buildflag_header.gni
├── check_gn_headers.py
├── check_gn_headers_unittest.py
├── check_gn_headers_whitelist.txt
├── check_return_value.py
├── ciopfs
├── ciopfs.sha1
├── cipd
│ ├── cipd.gni
│ └── cipd_from_file.py
├── clobber.py
├── clobber_unittest.py
├── compiled_action.gni
├── compute_build_timestamp.py
├── config
│ ├── BUILD.gn
│ ├── BUILDCONFIG.gn
│ ├── OWNERS
│ ├── aix
│ │ └── BUILD.gn
│ ├── android
│ │ ├── BUILD.gn
│ │ ├── DIR_METADATA
│ │ ├── OWNERS
│ │ ├── abi.gni
│ │ ├── android_nocompile.gni
│ │ ├── build_vars.gni
│ │ ├── channel.gni
│ │ ├── config.gni
│ │ ├── copy_ex.gni
│ │ ├── create_unwind_table.gni
│ │ ├── extract_unwind_tables.gni
│ │ ├── internal_rules.gni
│ │ ├── linker_version_script.gni
│ │ ├── rules.gni
│ │ ├── sdk.gni
│ │ ├── system_image.gni
│ │ └── test
│ │ │ ├── proto
│ │ │ ├── BUILD.gn
│ │ │ ├── absolute_dep
│ │ │ │ └── absolute_dep.proto
│ │ │ ├── relative_dep
│ │ │ │ └── relative_dep.proto
│ │ │ └── root
│ │ │ │ ├── absolute_child.proto
│ │ │ │ ├── absolute_root.proto
│ │ │ │ ├── relative_child.proto
│ │ │ │ └── relative_root.proto
│ │ │ └── resource_overlay
│ │ │ ├── BUILD.gn
│ │ │ └── java
│ │ │ ├── res_template
│ │ │ └── values
│ │ │ │ └── values.xml
│ │ │ └── src
│ │ │ └── org
│ │ │ └── chromium
│ │ │ └── build
│ │ │ └── resource_overlay
│ │ │ └── ResourceOverlayTest.java
│ ├── apple
│ │ ├── BUILD.gn
│ │ ├── OWNERS
│ │ ├── codesign.py
│ │ ├── compile_ib_files.py
│ │ ├── create_signed_bundle.gni
│ │ ├── find_signing_identity.py
│ │ ├── mobile_bundle_data.gni
│ │ ├── mobile_config.gni
│ │ ├── sdk_info.py
│ │ ├── swift_source_set.gni
│ │ ├── symbols.gni
│ │ ├── write_framework_hmap.py
│ │ └── write_framework_modulemap.py
│ ├── arm.gni
│ ├── buildflags_paint_preview.gni
│ ├── c++
│ │ ├── BUILD.gn
│ │ ├── c++.gni
│ │ └── libc++.natvis
│ ├── cast.gni
│ ├── chrome_build.gni
│ ├── chromebox_for_meetings
│ │ ├── BUILD.gn
│ │ ├── OWNERS
│ │ ├── README.md
│ │ └── buildflags.gni
│ ├── chromecast
│ │ ├── BUILD.gn
│ │ └── OWNERS
│ ├── chromeos
│ │ ├── BUILD.gn
│ │ ├── OWNERS
│ │ ├── args.gni
│ │ ├── rules.gni
│ │ └── ui_mode.gni
│ ├── clang
│ │ ├── BUILD.gn
│ │ └── clang.gni
│ ├── compiler
│ │ ├── BUILD.gn
│ │ ├── compiler.gni
│ │ └── pgo
│ │ │ ├── BUILD.gn
│ │ │ └── pgo.gni
│ ├── compute_inputs_for_analyze.gni
│ ├── coverage
│ │ ├── BUILD.gn
│ │ ├── OWNERS
│ │ └── coverage.gni
│ ├── cronet
│ │ ├── OWNERS
│ │ └── config.gni
│ ├── cuttlefish
│ │ ├── BUILD.gn
│ │ ├── README.md
│ │ └── buildflags.gni
│ ├── dcheck_always_on.gni
│ ├── devtools.gni
│ ├── features.gni
│ ├── freetype
│ │ ├── BUILD.gn
│ │ ├── OWNERS
│ │ └── freetype.gni
│ ├── fuchsia
│ │ ├── BUILD.gn
│ │ ├── DIR_METADATA
│ │ ├── OWNERS
│ │ ├── build_symbol_archive.py
│ │ ├── config.gni
│ │ ├── extend_fvm.py
│ │ ├── fuchsia_package_metadata.gni
│ │ ├── generate_runner_scripts.gni
│ │ ├── gn_configs.gni
│ │ ├── packaged_content_embedder_excluded_dirs.gni
│ │ ├── size_optimized_cast_receiver_args.gn
│ │ ├── size_optimized_cast_receiver_args_internal.gn
│ │ ├── sizes.gni
│ │ ├── symbol_archive.gni
│ │ └── test
│ │ │ ├── OWNERS
│ │ │ ├── README.md
│ │ │ ├── archivist.shard.test-cml
│ │ │ ├── asan_options.shard.test-cml
│ │ │ ├── audio_output.shard.test-cml
│ │ │ ├── chromium_system_test_facet.shard.test-cml
│ │ │ ├── chromium_test_facet.shard.test-cml
│ │ │ ├── context_provider.shard.test-cml
│ │ │ ├── elf_test_ambient_exec_runner.shard.test-cml
│ │ │ ├── elf_test_runner.shard.test-cml
│ │ │ ├── fonts.shard.test-cml
│ │ │ ├── logger.shard.test-cml
│ │ │ ├── mark_vmo_executable.shard.test-cml
│ │ │ ├── minimum.shard.test-cml
│ │ │ ├── network.shard.test-cml
│ │ │ ├── platform_video_codecs.shard.test-cml
│ │ │ ├── present_view.shard.test-cml
│ │ │ ├── sysmem.shard.test-cml
│ │ │ ├── system_test_minimum.shard.test-cml
│ │ │ ├── test_fonts.shard.test-cml
│ │ │ ├── test_ui_stack.shard.test-cml
│ │ │ └── web_instance.shard.test-cml
│ ├── gcc
│ │ └── BUILD.gn
│ ├── gclient_args.gni
│ ├── get_host_byteorder.py
│ ├── host_byteorder.gni
│ ├── ios
│ │ ├── BUILD.gn
│ │ ├── BuildInfo.plist
│ │ ├── Host-Info.plist
│ │ ├── Module-Info.plist
│ │ ├── OWNERS
│ │ ├── bundle_data_from_filelist.gni
│ │ ├── config.gni
│ │ ├── entitlements.plist
│ │ ├── extract_metadata.py
│ │ ├── generate_umbrella_header.py
│ │ ├── hardlink.py
│ │ ├── ios_sdk.gni
│ │ ├── ios_sdk_overrides.gni
│ │ ├── ios_test_runner_wrapper.gni
│ │ ├── ios_test_runner_xcuitest.gni
│ │ ├── resources
│ │ │ └── XCTRunnerAddition+Info.plist
│ │ ├── rules.gni
│ │ ├── strip_arm64e.py
│ │ └── xctest_shell.mm
│ ├── jumbo.gni
│ ├── linux
│ │ ├── BUILD.gn
│ │ ├── OWNERS
│ │ ├── atk
│ │ │ └── BUILD.gn
│ │ ├── atspi2
│ │ │ └── BUILD.gn
│ │ ├── dbus
│ │ │ └── BUILD.gn
│ │ ├── dri
│ │ │ └── BUILD.gn
│ │ ├── gtk
│ │ │ ├── BUILD.gn
│ │ │ └── gtk.gni
│ │ ├── libdrm
│ │ │ └── BUILD.gn
│ │ ├── libffi
│ │ │ └── BUILD.gn
│ │ ├── libva
│ │ │ └── BUILD.gn
│ │ ├── nss
│ │ │ └── BUILD.gn
│ │ ├── pangocairo
│ │ │ ├── BUILD.gn
│ │ │ └── pangocairo.gni
│ │ ├── pkg-config.py
│ │ └── pkg_config.gni
│ ├── locales.gni
│ ├── logging.gni
│ ├── loongarch64.gni
│ ├── mac
│ │ ├── BUILD.gn
│ │ ├── BuildInfo.plist
│ │ ├── OWNERS
│ │ ├── mac_sdk.gni
│ │ ├── mac_sdk_overrides.gni
│ │ ├── package_framework.py
│ │ ├── prepare_framework_version.py
│ │ └── rules.gni
│ ├── merge_for_jumbo.py
│ ├── mips.gni
│ ├── nacl
│ │ ├── BUILD.gn
│ │ ├── config.gni
│ │ ├── host_toolchain.gni
│ │ └── rules.gni
│ ├── ozone.gni
│ ├── ozone_extra.gni
│ ├── pch.gni
│ ├── posix
│ │ └── BUILD.gn
│ ├── profiling
│ │ ├── OWNERS
│ │ └── profiling.gni
│ ├── python.gni
│ ├── riscv.gni
│ ├── rts.gni
│ ├── rust.gni
│ ├── sanitizers
│ │ ├── BUILD.gn
│ │ ├── OWNERS
│ │ └── sanitizers.gni
│ ├── siso
│ │ ├── .gitignore
│ │ ├── DIR_METADATA
│ │ ├── OWNERS
│ │ ├── PRESUBMIT.py
│ │ ├── README.md
│ │ ├── android.star
│ │ ├── ar.star
│ │ ├── backend_config
│ │ │ ├── README.md
│ │ │ ├── google.star
│ │ │ └── template.star
│ │ ├── blink_all.star
│ │ ├── clang_all.star
│ │ ├── clang_code_coverage_wrapper.star
│ │ ├── clang_exception.star
│ │ ├── clang_linux.star
│ │ ├── clang_mac.star
│ │ ├── clang_unix.star
│ │ ├── clang_windows.star
│ │ ├── config.star
│ │ ├── configure_siso.py
│ │ ├── cros.star
│ │ ├── devtools_frontend.star
│ │ ├── fuchsia.star
│ │ ├── gn_logs.star
│ │ ├── linux.star
│ │ ├── mac.star
│ │ ├── mac_sdk.star
│ │ ├── main.star
│ │ ├── mojo.star
│ │ ├── nacl_linux.star
│ │ ├── nasm_linux.star
│ │ ├── platform.star
│ │ ├── proto_linux.star
│ │ ├── reproxy.star
│ │ ├── rewrapper_cfg.star
│ │ ├── rust_linux.star
│ │ ├── simple.star
│ │ ├── tsc.star
│ │ ├── typescript_all.star
│ │ ├── typescript_unix.star
│ │ ├── v8.star
│ │ ├── win_sdk.star
│ │ └── windows.star
│ ├── sysroot.gni
│ ├── ui.gni
│ ├── unsafe_buffers_paths.txt
│ ├── unwind.gni
│ ├── v8_target_cpu.gni
│ ├── win
│ │ ├── BUILD.gn
│ │ ├── console_app.gni
│ │ ├── control_flow_guard.gni
│ │ ├── manifest.gni
│ │ └── visual_studio_version.gni
│ ├── zip.gni
│ └── zos
│ │ └── BUILD.gn
├── copy_test_data_ios.py
├── cp.py
├── detect_host_arch.py
├── dir_exists.py
├── docs
│ ├── debugging_slow_builds.md
│ ├── mac_hermetic_toolchain.md
│ └── writing_gn_templates.md
├── dotfile_settings.gni
├── download_nacl_toolchains.py
├── env_dump.py
├── extract_from_cab.py
├── extract_partition.py
├── find_depot_tools.py
├── fix_gn_headers.py
├── fuchsia
│ ├── COMMON_METADATA
│ ├── DIR_METADATA
│ ├── OWNERS
│ ├── PRESUBMIT.py
│ ├── SECURITY_OWNERS
│ ├── __init__.py
│ ├── binary_size_differ.py
│ ├── binary_size_differ_test.py
│ ├── binary_sizes.py
│ ├── binary_sizes_test.py
│ ├── cipd
│ │ ├── BUILD.gn
│ │ ├── DIR_METADATA
│ │ ├── README.md
│ │ └── version.template
│ ├── gcs_download.py
│ ├── gcs_download_test.py
│ ├── gen_build_defs.py
│ ├── get_auth_token.py
│ ├── linux_internal.sdk.sha1
│ ├── sdk-bucket.txt
│ ├── test
│ │ ├── .coveragerc
│ │ ├── .style.yapf
│ │ ├── BUILD.gn
│ │ ├── PRESUBMIT.py
│ │ ├── boot_device.py
│ │ ├── browser_runner.py
│ │ ├── bundled_test_runner.py
│ │ ├── bundled_test_runner_unittests.py
│ │ ├── chrome_driver_wrapper.py
│ │ ├── common.py
│ │ ├── common_unittests.py
│ │ ├── compatible_utils.py
│ │ ├── compatible_utils_unittests.py
│ │ ├── coveragetest.py
│ │ ├── deploy_to_fuchsia.py
│ │ ├── deploy_to_fuchsia_unittests.py
│ │ ├── ffx_emulator.py
│ │ ├── ffx_emulator_unittests.py
│ │ ├── ffx_integration.py
│ │ ├── flash_device.py
│ │ ├── flash_device_unittests.py
│ │ ├── gs_util_wrapper.py
│ │ ├── isolate_daemon.py
│ │ ├── lockfile.py
│ │ ├── log_manager.py
│ │ ├── log_manager_unittests.py
│ │ ├── modification_waiter.py
│ │ ├── modification_waiter_unittests.py
│ │ ├── monitors.py
│ │ ├── monitors_unittests.py
│ │ ├── publish_package.py
│ │ ├── publish_package_unittests.py
│ │ ├── pylintrc
│ │ ├── run_blink_test.py
│ │ ├── run_executable_test.py
│ │ ├── run_pytype.py
│ │ ├── run_telemetry_test.py
│ │ ├── run_test.py
│ │ ├── run_webpage_test.py
│ │ ├── serial_boot_device.py
│ │ ├── serial_boot_device_unittests.py
│ │ ├── serve_repo.py
│ │ ├── serve_repo_unittests.py
│ │ ├── sshconfig
│ │ ├── start_emulator.py
│ │ ├── test_connection.py
│ │ ├── test_env_setup.py
│ │ ├── test_env_setup_unittests.py
│ │ ├── test_runner.py
│ │ ├── test_server.py
│ │ ├── test_server_unittests.py
│ │ ├── version.py
│ │ └── version_unittests.py
│ ├── update_product_bundles.py
│ ├── update_product_bundles_test.py
│ ├── update_sdk.py
│ └── update_sdk_test.py
├── gdb-add-index
├── get_landmines.py
├── get_symlink_targets.py
├── gn_ast
│ ├── .style.yapf
│ ├── README.md
│ ├── gn_ast.py
│ ├── gn_editor.py
│ ├── jni_refactor.py
│ ├── json_gn_editor.py
│ ├── json_gn_editor_test.py
│ └── utils.py
├── gn_editor
├── gn_helpers.py
├── gn_helpers_unittest.py
├── gn_logs.gni
├── gn_run_binary.py
├── install-build-deps.py
├── install-build-deps.sh
├── install-chroot.sh
├── internal
│ └── README.chromium
├── ios
│ ├── OWNERS
│ ├── PRESUBMIT.py
│ ├── extension_bundle_data.gni
│ ├── intent_definition.gni
│ ├── presubmit_support.py
│ ├── presubmit_support_test.py
│ ├── test_data
│ │ ├── bar.html
│ │ ├── basic.filelist
│ │ ├── basic.globlist
│ │ ├── comment.filelist
│ │ ├── comment.globlist
│ │ ├── different_local_path.filelist
│ │ ├── different_local_path.globlist
│ │ ├── duplicates.filelist
│ │ ├── duplicates.globlist
│ │ ├── exclusions.filelist
│ │ ├── exclusions.globlist
│ │ ├── extra.filelist
│ │ ├── extra.globlist
│ │ ├── foo.css
│ │ ├── ignore_outside_globlist_dir.filelist
│ │ ├── ignore_outside_globlist_dir.globlist
│ │ ├── missing.filelist
│ │ ├── missing.globlist
│ │ ├── outside_globlist_dir.filelist
│ │ ├── outside_globlist_dir.globlist
│ │ ├── reorder.filelist
│ │ ├── reorder.globlist
│ │ ├── repository_relative.filelist
│ │ ├── repository_relative.globlist
│ │ └── subdirectory
│ │ │ └── baz.txt
│ └── update_bundle_filelist.py
├── landmine_utils.py
├── landmines.py
├── linux
│ ├── BUILD.gn
│ ├── OWNERS
│ ├── chrome.map
│ ├── dump_app_syms.py
│ ├── extract_symbols.gni
│ ├── install-chromeos-fonts.py
│ ├── libncursesw
│ │ ├── DIR_METADATA
│ │ └── OWNERS
│ ├── libpci
│ │ └── BUILD.gn
│ ├── rewrite_dirs.py
│ ├── strip_binary.gni
│ ├── strip_binary.py
│ ├── sysroot_scripts
│ │ ├── .style.yapf
│ │ ├── build_and_upload.py
│ │ ├── generate_keyring.sh
│ │ ├── generated_package_lists
│ │ │ ├── bullseye.amd64
│ │ │ ├── bullseye.arm64
│ │ │ ├── bullseye.armhf
│ │ │ ├── bullseye.i386
│ │ │ ├── bullseye.mips64el
│ │ │ └── bullseye.mipsel
│ │ ├── install-sysroot.py
│ │ ├── keyring.gpg
│ │ ├── libxcomposite1-symbols
│ │ ├── sysroot.gni
│ │ ├── sysroot_creator.py
│ │ ├── sysroots.json
│ │ └── update-archive-timestamp.sh
│ └── unbundle
│ │ ├── README
│ │ ├── absl_algorithm.gn
│ │ ├── absl_base.gn
│ │ ├── absl_cleanup.gn
│ │ ├── absl_container.gn
│ │ ├── absl_crc.gn
│ │ ├── absl_debugging.gn
│ │ ├── absl_flags.gn
│ │ ├── absl_functional.gn
│ │ ├── absl_hash.gn
│ │ ├── absl_log.gn
│ │ ├── absl_log_internal.gn
│ │ ├── absl_memory.gn
│ │ ├── absl_meta.gn
│ │ ├── absl_numeric.gn
│ │ ├── absl_random.gn
│ │ ├── absl_status.gn
│ │ ├── absl_strings.gn
│ │ ├── absl_synchronization.gn
│ │ ├── absl_time.gn
│ │ ├── absl_types.gn
│ │ ├── absl_utility.gn
│ │ ├── brotli.gn
│ │ ├── crc32c.gn
│ │ ├── dav1d.gn
│ │ ├── double-conversion.gn
│ │ ├── ffmpeg.gn
│ │ ├── flac.gn
│ │ ├── flatbuffers.gn
│ │ ├── fontconfig.gn
│ │ ├── freetype.gn
│ │ ├── harfbuzz-ng.gn
│ │ ├── highway.gn
│ │ ├── icu.gn
│ │ ├── jsoncpp.gn
│ │ ├── libXNVCtrl.gn
│ │ ├── libaom.gn
│ │ ├── libavif.gn
│ │ ├── libdrm.gn
│ │ ├── libevent.gn
│ │ ├── libjpeg.gn
│ │ ├── libpng.gn
│ │ ├── libsecret.gn
│ │ ├── libusb.gn
│ │ ├── libvpx.gn
│ │ ├── libwebp.gn
│ │ ├── libxml.gn
│ │ ├── libxslt.gn
│ │ ├── libyuv.gn
│ │ ├── openh264.gn
│ │ ├── openh264_encoder_cfi_ignores.txt
│ │ ├── opus.gn
│ │ ├── re2.gn
│ │ ├── remove_bundled_libraries.py
│ │ ├── replace_gn_files.py
│ │ ├── snappy.gn
│ │ ├── swiftshader-SPIRV-Headers.gn
│ │ ├── swiftshader-SPIRV-Tools.gn
│ │ ├── vulkan-SPIRV-Headers.gn
│ │ ├── vulkan-SPIRV-Tools.gn
│ │ ├── vulkan_memory_allocator.gn
│ │ ├── woff2.gn
│ │ ├── zlib.gn
│ │ └── zstd.gn
├── locale_tool.py
├── mac
│ ├── OWNERS
│ ├── find_sdk.py
│ └── should_use_hermetic_xcode.py
├── mac_toolchain.py
├── metadata.json.in
├── nocompile.gni
├── noop.py
├── partitioned_shared_library.gni
├── precompile.cc
├── precompile.h
├── print_python_deps.py
├── private_code_test
│ ├── BUILD.gn
│ ├── README.md
│ ├── list_gclient_deps.py
│ ├── private_code_test.gni
│ └── private_code_test.py
├── protoc_java.py
├── protoc_java.pydeps
├── redirect_stdout.py
├── rm.py
├── rust
│ ├── BUILD.gn
│ ├── OWNERS
│ ├── bindings.rs
│ ├── cargo_crate.gni
│ ├── chromium_prelude
│ │ ├── BUILD.gn
│ │ ├── chromium_prelude.rs
│ │ ├── import_attribute.rs
│ │ ├── import_test.rs
│ │ └── import_test_lib.rs
│ ├── crubit
│ │ └── BUILD.gn
│ ├── cxx_version.gni
│ ├── filter_clang_args.py
│ ├── rs_bindings_from_cc.gni
│ ├── run_bindgen.py
│ ├── run_build_script.py
│ ├── run_rs_bindings_from_cc.py
│ ├── rust_bindgen.gni
│ ├── rust_bindgen_generator.gni
│ ├── rust_executable.gni
│ ├── rust_macro.gni
│ ├── rust_shared_library.gni
│ ├── rust_static_library.gni
│ ├── rust_target.gni
│ ├── rust_unit_test.gni
│ ├── rust_unit_tests_group.gni
│ ├── rustc_wrapper.py
│ ├── std
│ │ ├── BUILD.gn
│ │ ├── BUILD.gn.hbs
│ │ ├── DEPS
│ │ ├── alias.cc
│ │ ├── alias.h
│ │ ├── compiler_specific.h
│ │ ├── fake_root
│ │ │ ├── .cargo
│ │ │ │ └── config.toml.template
│ │ │ ├── .gitignore
│ │ │ ├── Cargo.toml.template
│ │ │ ├── README.md
│ │ │ └── src
│ │ │ │ └── main.rs
│ │ ├── find_std_rlibs.py
│ │ ├── gnrt_config.toml
│ │ ├── immediate_crash.h
│ │ ├── remap_alloc.cc
│ │ └── rules
│ │ │ └── BUILD.gn
│ ├── tests
│ │ ├── BUILD.gn
│ │ ├── bindgen_cpp_test
│ │ │ ├── BUILD.gn
│ │ │ ├── cpp.cc
│ │ │ ├── cpp.h
│ │ │ └── main.rs
│ │ ├── bindgen_cpp_test_with_cpp_linkage
│ │ │ ├── BUILD.gn
│ │ │ ├── cpp.cc
│ │ │ ├── cpp.h
│ │ │ ├── lib.rs
│ │ │ └── main.cc
│ │ ├── bindgen_static_fns_test
│ │ │ ├── BUILD.gn
│ │ │ ├── lib.c
│ │ │ ├── lib.h
│ │ │ ├── main.rs
│ │ │ └── src
│ │ │ │ └── lib.rs
│ │ ├── bindgen_test
│ │ │ ├── BUILD.gn
│ │ │ ├── lib.c
│ │ │ ├── lib.h
│ │ │ ├── lib2.h
│ │ │ ├── main.rs
│ │ │ └── src
│ │ │ │ └── lib.rs
│ │ ├── test_aliased_deps
│ │ │ ├── BUILD.gn
│ │ │ ├── lib.rs
│ │ │ ├── main.rs
│ │ │ └── real_name.rs
│ │ ├── test_bin_crate
│ │ │ ├── BUILD.gn
│ │ │ └── crate
│ │ │ │ ├── build.rs
│ │ │ │ └── src
│ │ │ │ ├── main.rs
│ │ │ │ └── more.rs
│ │ ├── test_control_flow_guard
│ │ │ ├── BUILD.gn
│ │ │ └── test_control_flow_guard.rs
│ │ ├── test_cpp_including_rust
│ │ │ ├── BUILD.gn
│ │ │ ├── main.cc
│ │ │ ├── shared_unittests.cc
│ │ │ └── static_unittests.cc
│ │ ├── test_proc_macro_crate
│ │ │ ├── BUILD.gn
│ │ │ └── crate
│ │ │ │ └── src
│ │ │ │ └── lib.rs
│ │ ├── test_rlib_crate
│ │ │ ├── BUILD.gn
│ │ │ └── crate
│ │ │ │ ├── build.rs
│ │ │ │ └── src
│ │ │ │ ├── lib.rs
│ │ │ │ └── main.rs
│ │ ├── test_rlib_crate_testonly
│ │ │ ├── BUILD.gn
│ │ │ └── crate
│ │ │ │ ├── build.rs
│ │ │ │ └── src
│ │ │ │ ├── lib.rs
│ │ │ │ └── main.rs
│ │ ├── test_rs_bindings_from_cc
│ │ │ ├── BUILD.gn
│ │ │ ├── main.rs
│ │ │ ├── self_contained_target_header1.h
│ │ │ ├── self_contained_target_header2.cc
│ │ │ ├── self_contained_target_header2.h
│ │ │ └── target_depending_on_another.h
│ │ ├── test_rust_calling_cpp
│ │ │ ├── BUILD.gn
│ │ │ ├── cpp_library.cc
│ │ │ ├── cpp_library.h
│ │ │ ├── main.cc
│ │ │ └── rust_calling_cpp_rlib.rs
│ │ ├── test_rust_exe
│ │ │ ├── BUILD.gn
│ │ │ └── main.rs
│ │ ├── test_rust_metadata
│ │ │ ├── BUILD.gn
│ │ │ ├── foo_dependency.rs
│ │ │ ├── lib.rs
│ │ │ ├── main.cc
│ │ │ ├── main.rs
│ │ │ ├── tests.rs
│ │ │ └── transitive_dep.rs
│ │ ├── test_rust_multiple_dep_versions_exe
│ │ │ ├── BUILD.gn
│ │ │ ├── main.rs
│ │ │ ├── transitive_lib.rs
│ │ │ ├── v1
│ │ │ │ ├── BUILD.gn
│ │ │ │ └── src
│ │ │ │ │ └── lib.rs
│ │ │ └── v2
│ │ │ │ ├── BUILD.gn
│ │ │ │ └── src
│ │ │ │ └── lib.rs
│ │ ├── test_rust_shared_library
│ │ │ ├── BUILD.gn
│ │ │ └── src
│ │ │ │ └── lib.rs
│ │ ├── test_rust_static_library
│ │ │ ├── BUILD.gn
│ │ │ └── src
│ │ │ │ └── lib.rs
│ │ ├── test_rust_static_library_non_standard_arrangement
│ │ │ ├── BUILD.gn
│ │ │ └── foo.rs
│ │ ├── test_rust_unittests
│ │ │ ├── BUILD.gn
│ │ │ └── main.rs
│ │ ├── test_serde_json_lenient
│ │ │ ├── BUILD.gn
│ │ │ ├── lib.rs
│ │ │ └── unittests.cc
│ │ ├── test_simple_rust_exe
│ │ │ ├── BUILD.gn
│ │ │ └── main.rs
│ │ └── windows_sys_test
│ │ │ ├── BUILD.gn
│ │ │ └── main.rs
│ └── write_rustflags.py
├── sample_arg_file.gn
├── sanitize-mac-build-log.sed
├── sanitize-mac-build-log.sh
├── sanitize-win-build-log.sed
├── sanitize-win-build-log.sh
├── sanitizers
│ ├── OWNERS
│ ├── asan_suppressions.cc
│ ├── dlcloseshim.c
│ ├── lsan_suppressions.cc
│ ├── sanitizer_options.cc
│ └── tsan_suppressions.cc
├── shim_headers.gni
├── skia_gold_common
│ ├── .style.yapf
│ ├── OWNERS
│ ├── PRESUBMIT.py
│ ├── README.md
│ ├── __init__.py
│ ├── output_managerless_skia_gold_session.py
│ ├── output_managerless_skia_gold_session_unittest.py
│ ├── run_pytype.py
│ ├── skia_gold_properties.py
│ ├── skia_gold_properties_unittest.py
│ ├── skia_gold_session.py
│ ├── skia_gold_session_manager.py
│ ├── skia_gold_session_manager_unittest.py
│ ├── skia_gold_session_unittest.py
│ └── unittest_utils.py
├── split_static_library.gni
├── symlink.gni
├── symlink.py
├── timestamp.gni
├── toolchain
│ ├── BUILD.gn
│ ├── OWNERS
│ ├── aix
│ │ └── BUILD.gn
│ ├── android
│ │ ├── BUILD.gn
│ │ ├── DIR_METADATA
│ │ └── OWNERS
│ ├── apple
│ │ ├── .style.yapf
│ │ ├── BUILD.gn
│ │ ├── OWNERS
│ │ ├── compile_xcassets.py
│ │ ├── compile_xcassets_unittests.py
│ │ ├── filter_libtool.py
│ │ ├── get_tool_mtime.py
│ │ ├── linker_driver.py
│ │ ├── swift_const_gather_protocols.json
│ │ ├── swiftc.py
│ │ └── toolchain.gni
│ ├── cc_wrapper.gni
│ ├── check_rewrapper_cfg.py
│ ├── clang_code_coverage_wrapper.py
│ ├── concurrent_links.gni
│ ├── cros
│ │ ├── BUILD.gn
│ │ └── cros_config.gni
│ ├── cros_toolchain.gni
│ ├── fuchsia
│ │ ├── BUILD.gn
│ │ ├── DIR_METADATA
│ │ └── OWNERS
│ ├── gcc_link_wrapper.py
│ ├── gcc_solink_wrapper.py
│ ├── gcc_toolchain.gni
│ ├── get_concurrent_links.py
│ ├── get_cpu_count.py
│ ├── ios
│ │ ├── BUILD.gn
│ │ └── OWNERS
│ ├── kythe.gni
│ ├── linux
│ │ ├── BUILD.gn
│ │ └── unbundle
│ │ │ ├── BUILD.gn
│ │ │ └── README.md
│ ├── mac
│ │ ├── BUILD.gn
│ │ └── OWNERS
│ ├── nacl
│ │ └── BUILD.gn
│ ├── nacl_toolchain.gni
│ ├── rbe.gni
│ ├── siso.gni
│ ├── toolchain.gni
│ ├── use_reclient_value.py
│ ├── use_remoteexec_value.py
│ ├── use_siso_default.py
│ ├── whole_archive.py
│ ├── win
│ │ ├── BUILD.gn
│ │ ├── midl.gni
│ │ ├── midl.py
│ │ ├── ml.py
│ │ ├── rc
│ │ │ ├── .gitignore
│ │ │ ├── README.md
│ │ │ ├── linux64
│ │ │ │ └── rc.sha1
│ │ │ ├── mac
│ │ │ │ └── rc.sha1
│ │ │ ├── rc.py
│ │ │ ├── upload_rc_binaries.sh
│ │ │ └── win
│ │ │ │ └── rc.exe.sha1
│ │ ├── setup_toolchain.py
│ │ ├── tool_wrapper.py
│ │ ├── toolchain.gni
│ │ └── win_toolchain_data.gni
│ ├── wrapper_utils.py
│ └── zos
│ │ └── BUILD.gn
├── tree_truth.sh
├── update-linux-sandbox.sh
├── util
│ ├── BUILD.gn
│ ├── LASTCHANGE
│ ├── LASTCHANGE.committime
│ ├── LASTCHANGE.dummy
│ ├── PRESUBMIT.py
│ ├── action_remote.py
│ ├── android_chrome_version.py
│ ├── android_chrome_version_test.py
│ ├── branding.gni
│ ├── chromium_git_revision.h.in
│ ├── generate_wrapper.gni
│ ├── generate_wrapper.py
│ ├── ide_query
│ ├── java_action.gni
│ ├── java_action.py
│ ├── lastchange.gni
│ ├── lastchange.py
│ ├── lib
│ │ ├── __init__.py
│ │ ├── common
│ │ │ ├── PRESUBMIT.py
│ │ │ ├── __init__.py
│ │ │ ├── chrome_test_server_spawner.py
│ │ │ ├── perf_result_data_type.py
│ │ │ ├── perf_tests_results_helper.py
│ │ │ ├── unittest_util.py
│ │ │ ├── unittest_util_test.py
│ │ │ └── util.py
│ │ ├── proto
│ │ │ ├── OWNERS
│ │ │ ├── PRESUBMIT.py
│ │ │ ├── README.md
│ │ │ ├── __init__.py
│ │ │ ├── average.py
│ │ │ ├── average_unittests.py
│ │ │ ├── count.py
│ │ │ ├── count_unittests.py
│ │ │ ├── data_points.py
│ │ │ ├── data_points_unittests.py
│ │ │ ├── exception_occurrences.proto
│ │ │ ├── exception_occurrences_pb2.py
│ │ │ ├── exception_recorder.py
│ │ │ ├── exception_recorder_unittests.py
│ │ │ ├── measure.py
│ │ │ ├── measures.py
│ │ │ ├── measures_unittests.py
│ │ │ ├── metric.py
│ │ │ ├── metric_unittests.py
│ │ │ ├── test_script_metrics.proto
│ │ │ ├── test_script_metrics_pb2.py
│ │ │ ├── time_consumption.py
│ │ │ └── time_consumption_unittests.py
│ │ └── results
│ │ │ ├── DIR_METADATA
│ │ │ ├── OWNERS
│ │ │ ├── __init__.py
│ │ │ ├── result_sink.py
│ │ │ ├── result_sink_test.py
│ │ │ └── result_types.py
│ ├── process_version.gni
│ ├── version.py
│ └── version_test.py
├── vs_toolchain.py
├── whitespace_file.txt
├── win
│ ├── BUILD.gn
│ ├── as_invoker.manifest
│ ├── common_controls.manifest
│ ├── compatibility.manifest
│ ├── copy_cdb_to_output.py
│ ├── gn_meta_sln.py
│ ├── message_compiler.gni
│ ├── message_compiler.py
│ ├── reorder-imports.py
│ ├── require_administrator.manifest
│ ├── segment_heap.manifest
│ ├── set_appcontainer_acls.py
│ └── use_ansi_codes.py
├── write_buildflag_header.py
├── xcode_binaries.yaml
├── zip_helpers.py
└── zip_helpers_unittest.py
├── build_overrides
├── build.gni
├── gtest.gni
└── partition_alloc.gni
├── buildtools
├── deps_revisions.gni
├── linux64
│ └── ninja
├── mac
│ └── ninja
├── third_party
│ ├── eu-strip
│ │ ├── OWNERS
│ │ ├── README.chromium
│ │ ├── bin
│ │ │ └── eu-strip
│ │ ├── build.sh
│ │ └── fix-elf-size.patch
│ ├── libc++
│ │ ├── BUILD.gn
│ │ ├── OWNERS
│ │ ├── __assertion_handler
│ │ └── __config_site
│ ├── libc++abi
│ │ ├── BUILD.gn
│ │ ├── OWNERS
│ │ └── cxa_demangle_stub.cc
│ └── libunwind
│ │ ├── BUILD.gn
│ │ └── OWNERS
└── win
│ └── ninja.exe
├── examples
├── buildflag
│ ├── .gn
│ ├── BUILD.gn
│ └── main.cc
├── gtest
│ ├── .gn
│ ├── BUILD.gn
│ ├── run_all_unittests.cc
│ └── some_unittest.cc
├── libcxx
│ ├── .gn
│ ├── BUILD.gn
│ └── main.cc
└── simple
│ ├── .gn
│ ├── BUILD.gn
│ └── main.cc
├── scripts
├── bootstrap.js
├── build.js
├── common.js
├── create_dist.js
├── libs
│ ├── extract-zip.js
│ ├── fs-extra.js
│ ├── jszip.js
│ └── node-fetch.js
├── test.js
└── update_gn.js
├── third_party
├── catapult
│ └── tracing
│ │ └── BUILD.gn
├── depot_tools
│ ├── gclient.py
│ ├── gn_helper.py
│ └── win_toolchain
│ │ ├── get_toolchain_if_necessary.py
│ │ └── package_from_installed.py
├── googletest
│ ├── BUILD.gn
│ ├── DEPS
│ ├── DIR_METADATA
│ ├── OWNERS
│ ├── README.chromium
│ └── custom
│ │ └── gtest
│ │ └── internal
│ │ └── custom
│ │ ├── DEPS
│ │ ├── chrome_custom_temp_dir.cc
│ │ ├── chrome_custom_temp_dir.h
│ │ ├── gtest.h
│ │ ├── gtest_port_wrapper.cc
│ │ ├── stack_trace_getter.cc
│ │ └── stack_trace_getter.h
├── libc++
│ ├── OWNERS
│ ├── README.chromium
│ └── README.md
├── libc++abi
│ ├── OWNERS
│ ├── README.chromium
│ └── README.md
├── libunwind
│ ├── OWNERS
│ ├── README.chromium
│ └── README.md
└── llvm-libc
│ ├── BUILD.gn
│ ├── OWNERS
│ ├── README.chromium
│ └── README.md
└── tools
├── cfi
├── OWNERS
└── ignores.txt
├── clang
└── scripts
│ └── update.py
└── win
└── DebugVisualizers
├── BUILD.gn
├── README.md
├── blink.natvis
└── chrome.natvis
/.gitattributes:
--------------------------------------------------------------------------------
1 | build/* linguist-vendored
2 | tools/* linguist-vendored
3 | testing/* linguist-vendored
4 | third_party/* linguist-vendored
5 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .tags*
3 | /out/
4 | /third_party/llvm-build/
5 | /third_party/node-*/
6 | /build/linux/debian_*-sysroot/
7 | /buildtools/linux64/
8 | /buildtools/mac/
9 | /buildtools/win/
10 | node_modules/
11 | *.xcodeproj
12 | *.swp
13 | *.pyc
14 | debug.log
15 | npm-debug.log
16 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "testing"]
2 | path = testing
3 | url = https://chromium.googlesource.com/chromium/src/testing
4 | [submodule "third_party/googletest/src"]
5 | path = third_party/googletest/src
6 | url = https://github.com/google/googletest
7 | [submodule "tools/gn"]
8 | path = tools/gn
9 | url = https://github.com/yue/gn
10 | [submodule "third_party/libc++/src"]
11 | path = third_party/libc++/src
12 | url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx
13 | [submodule "third_party/libc++abi/src"]
14 | path = third_party/libc++abi/src
15 | url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi
16 | [submodule "third_party/libunwind/src"]
17 | path = third_party/libunwind/src
18 | url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind
19 | [submodule "third_party/llvm-libc/src"]
20 | path = third_party/llvm-libc/src
21 | url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libc
22 |
--------------------------------------------------------------------------------
/.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2016 Cheng Zhao. All rights reserved.
2 | # Use of this source code is governed by the MIT license that can be
3 | # found in the LICENSE file.
4 |
5 | # This file is used by the gn meta-buildsystem find the root of the source tree
6 | # and to set startup options.
7 |
8 | # The location of the build configuration file.
9 | buildconfig = "//build/config/BUILDCONFIG.gn"
10 |
11 | # The secondary source root is a parallel directory tree where
12 | # GN build files are placed when they can not be placed directly
13 | # in the source tree, e.g. for third party source trees.
14 | secondary_source = "//build/secondary/"
15 |
--------------------------------------------------------------------------------
/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2016 Cheng Zhao. All rights reserved.
2 | # Use of this source code is governed by the MIT license that can be
3 | # found in the LICENSE file.
4 |
5 | group("default") {
6 | deps = [
7 | "//tools/gn",
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/build/3pp_common/.style.yapf:
--------------------------------------------------------------------------------
1 | [style]
2 | based_on_style = pep8
3 |
--------------------------------------------------------------------------------
/build/DIR_METADATA:
--------------------------------------------------------------------------------
1 | monorail: {
2 | component: "Build"
3 | }
4 | team_email: "build@chromium.org"
5 | buganizer_public: {
6 | component_id: 1456832
7 | }
8 |
--------------------------------------------------------------------------------
/build/OWNERS.status:
--------------------------------------------------------------------------------
1 | # Use this file to set a global status message that should be shown whenever
2 | # git cl owners proposes to add you as a reviewer.
3 | #
4 | # The status messages should be somewhat stable, so please don't use this for
5 | # short term, or frequently changing updates.
6 | #
7 | # The format of the file is
8 | #
9 | # you@chromium.org: Single line status message.
10 | #
11 |
12 |
--------------------------------------------------------------------------------
/build/apple/OWNERS:
--------------------------------------------------------------------------------
1 | mark@chromium.org
2 | rohitrao@chromium.org
3 | sdefresne@chromium.org
4 |
--------------------------------------------------------------------------------
/build/apple/README.md:
--------------------------------------------------------------------------------
1 | # About
2 |
3 | `//build/apple` contains:
4 | * GN templates and configurations shared by Apple platforms
5 | * Python build scripts shared by Apple platforms
6 |
7 | This directory should only contain templates, configurations and scripts
8 | that are used exclusively on Apple platforms (currently iOS and macOS).
9 | They must also be independent of the specific platform.
10 |
11 | If a template, configuration or script is limited to only iOS or macOS,
12 | then they should instead be located in `//build/ios` or `//build/mac`.
13 |
--------------------------------------------------------------------------------
/build/args/OWNERS:
--------------------------------------------------------------------------------
1 | per-file headless.gn=file://headless/OWNERS
2 |
--------------------------------------------------------------------------------
/build/check_return_value.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # Copyright 2014 The Chromium Authors
3 | # Use of this source code is governed by a BSD-style license that can be
4 | # found in the LICENSE file.
5 |
6 | """This program wraps an arbitrary command and prints "1" if the command ran
7 | successfully."""
8 |
9 |
10 | import os
11 | import subprocess
12 | import sys
13 |
14 | devnull = open(os.devnull, 'wb')
15 | if not subprocess.call(sys.argv[1:], stdout=devnull, stderr=devnull):
16 | print(1)
17 | else:
18 | print(0)
19 |
--------------------------------------------------------------------------------
/build/ciopfs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yue/build-gn/0b9681cd9ea457b2262f279be30e1fbd4ea81ebd/build/ciopfs
--------------------------------------------------------------------------------
/build/ciopfs.sha1:
--------------------------------------------------------------------------------
1 | 5454b3c4f1c9992047e7ae9d6d14d5b49b1b12f3
--------------------------------------------------------------------------------
/build/config/OWNERS:
--------------------------------------------------------------------------------
1 | per-file ozone.gni=file://ui/ozone/OWNERS
2 | per-file ozone_extra.gni=file://ui/ozone/OWNERS
3 | per-file rust.gni=file://build/rust/OWNERS
4 | per-file cast.gni=file://build/config/chromecast/OWNERS
5 |
6 | per-file unsafe_buffers_paths.txt=arthursonzogni@chromium.org
7 | per-file unsafe_buffers_paths.txt=tsepez@chromium.org
8 |
--------------------------------------------------------------------------------
/build/config/android/DIR_METADATA:
--------------------------------------------------------------------------------
1 | mixins: "//build/android/COMMON_METADATA"
2 |
--------------------------------------------------------------------------------
/build/config/android/OWNERS:
--------------------------------------------------------------------------------
1 | file://build/android/OWNERS
2 |
--------------------------------------------------------------------------------
/build/config/android/channel.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2014 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | declare_args() {
6 | # The channel to build on Android: stable, beta, dev, canary, work, or
7 | # default. "default" should be used on non-official builds.
8 | android_channel = "default"
9 | }
10 |
11 | assert(android_channel == "default" || android_channel == "canary" ||
12 | android_channel == "dev" || android_channel == "beta" ||
13 | android_channel == "stable",
14 | "Invalid channel: " + android_channel)
15 |
--------------------------------------------------------------------------------
/build/config/android/sdk.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2017 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | # The default SDK release used by public builds. Value may differ in
6 | # internal builds.
7 | default_android_sdk_release = "v"
8 |
9 | # SDK releases against which public builds are supported.
10 | public_sdk_releases = [ "v" ]
11 |
--------------------------------------------------------------------------------
/build/config/android/test/proto/absolute_dep/absolute_dep.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | syntax = "proto2";
6 |
7 | package build.config.android.test;
8 | option java_package = "build.config.android.test";
9 |
10 | message AbsoluteDep {}
11 |
--------------------------------------------------------------------------------
/build/config/android/test/proto/relative_dep/relative_dep.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | syntax = "proto2";
6 |
7 | package build.config.android.test;
8 | option java_package = "build.config.android.test";
9 |
10 | message RelativeDep {}
11 |
--------------------------------------------------------------------------------
/build/config/android/test/proto/root/absolute_child.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | syntax = "proto2";
6 |
7 | package build.config.android.test;
8 | option java_package = "build.config.android.test";
9 |
10 | message AbsoluteChild {}
11 |
--------------------------------------------------------------------------------
/build/config/android/test/proto/root/absolute_root.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | syntax = "proto2";
6 |
7 | package build.config.android.test;
8 | option java_package = "build.config.android.test";
9 |
10 | import "build/config/android/test/proto/root/absolute_child.proto";
11 | import "build/config/android/test/proto/absolute_dep/absolute_dep.proto";
12 | import "relative_dep.proto";
13 |
14 | message AbsoluteRoot {
15 | optional AbsoluteChild absolute_child = 1;
16 | optional AbsoluteDep absolute_dep = 2;
17 | optional RelativeDep relative_dep = 3;
18 | }
19 |
--------------------------------------------------------------------------------
/build/config/android/test/proto/root/relative_child.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | syntax = "proto2";
6 |
7 | package build.config.android.test;
8 | option java_package = "build.config.android.test";
9 |
10 | message RelativeChild {}
11 |
--------------------------------------------------------------------------------
/build/config/android/test/proto/root/relative_root.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | syntax = "proto2";
6 |
7 | package build.config.android.test;
8 | option java_package = "build.config.android.test";
9 |
10 | import "relative_child.proto";
11 | import "build/config/android/test/proto/absolute_dep/absolute_dep.proto";
12 | import "relative_dep.proto";
13 |
14 | message RelativeRoot {
15 | optional RelativeChild relative_child = 1;
16 | optional AbsoluteDep absolute_dep = 2;
17 | optional RelativeDep relative_dep = 3;
18 | }
19 |
--------------------------------------------------------------------------------
/build/config/android/test/resource_overlay/java/res_template/values/values.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | {{resource_value}}
10 |
--------------------------------------------------------------------------------
/build/config/apple/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/apple/symbols.gni")
6 |
7 | # The ldflags referenced below are handled by
8 | # //build/toolchain/apple/linker_driver.py.
9 | # Remove this config if a target wishes to change the arguments passed to the
10 | # strip command during linking. This config by default strips all symbols
11 | # from a binary, but some targets may wish to specify an exports file to
12 | # preserve specific symbols.
13 | config("strip_all") {
14 | if (enable_stripping) {
15 | ldflags = [ "-Wcrl,strip,-x,-S" ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/build/config/apple/OWNERS:
--------------------------------------------------------------------------------
1 | file://build/apple/OWNERS
2 |
--------------------------------------------------------------------------------
/build/config/apple/write_framework_modulemap.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import os
6 | import sys
7 |
8 | MODULE_MAP_TEMPLATE = '''\
9 | framework module %(framework_name)s {
10 | umbrella header "%(framework_name)s.h"
11 |
12 | export *
13 | module * { export * }
14 | }
15 | '''
16 |
17 |
18 | def Main(framework_name, modules_dir):
19 | # Find the name of the binary based on the part before the ".framework".
20 | if not os.path.isdir(modules_dir):
21 | os.makedirs(modules_dir)
22 |
23 | with open(os.path.join(modules_dir, 'module.modulemap'), 'w') as module_file:
24 | module_file.write(MODULE_MAP_TEMPLATE % {'framework_name': framework_name})
25 |
26 |
27 | if __name__ == '__main__':
28 | Main(*sys.argv[1:])
29 |
--------------------------------------------------------------------------------
/build/config/buildflags_paint_preview.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2019 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/cast.gni")
6 | import("//build/config/features.gni")
7 |
8 | declare_args() {
9 | # Enable basic paint preview support. Does not work on iOS. Should
10 | # not be included with Chromecast hardware devices.
11 | # Used by //components/paint_preview and //third_party/harfbuzz-ng.
12 | # TODO(crbug.com/webrtc/11223) Move back this file in
13 | # //components/paint_preview/ once WebRTC doesn't roll harfbuzz-ng anymore,
14 | # for consistency sake.
15 | enable_paint_preview = !is_castos && !is_cast_android && !is_ios
16 | }
17 |
--------------------------------------------------------------------------------
/build/config/chromebox_for_meetings/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2020 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/buildflag_header.gni")
6 | import("//build/config/chromebox_for_meetings/buildflags.gni")
7 |
8 | buildflag_header("buildflags") {
9 | header = "buildflags.h"
10 | flags = [ "PLATFORM_CFM=$is_cfm" ]
11 | }
12 |
--------------------------------------------------------------------------------
/build/config/chromebox_for_meetings/OWNERS:
--------------------------------------------------------------------------------
1 | file://chromeos/ash/components/chromebox_for_meetings/OWNERS
2 |
--------------------------------------------------------------------------------
/build/config/chromebox_for_meetings/README.md:
--------------------------------------------------------------------------------
1 | # CfM GN Build Flags
2 |
3 | Note: GN Flags are Build time flags
4 |
5 | You can get a comprehensive list of all arguments supported by gn by running the
6 | command gn args --list out/some-directory (the directory passed to gn args is
7 | required as gn args will invokes gn gen to generate the build.ninja files).
8 |
9 | ## is_cfm (BUILDFLAG(PLATFORM_CFM))
10 |
11 | Flag for building chromium for CfM devices.
12 |
13 | ### Query Flag
14 | ```bash
15 | $ gn args out_/{Release||Debug} --list=is_cfm
16 | ```
17 |
18 | ### Enable Flag
19 | ```bash
20 | $ gn args out_/{Release||Debug}
21 | $ Editor will open add is_cfm=true save and exit
22 | ```
23 |
24 | ### Alt: EnrollmentRequisitionManager
25 |
26 | We can alternatively use the EnrollmentRequisitionManager to determine if
27 | chromium is running a CfM enabled Platform in source code
28 |
29 | ```cpp
30 | policy::EnrollmentRequisitionManager::IsRemoraRequisition();
31 | ```
32 |
--------------------------------------------------------------------------------
/build/config/chromebox_for_meetings/buildflags.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2020 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | declare_args() {
6 | # True if compiling for Chromebox for Meeting devices.
7 | is_cfm = false
8 | }
9 |
--------------------------------------------------------------------------------
/build/config/chromecast/OWNERS:
--------------------------------------------------------------------------------
1 | mfoltz@chromium.org
2 | seantopping@chromium.org
3 |
--------------------------------------------------------------------------------
/build/config/chromeos/OWNERS:
--------------------------------------------------------------------------------
1 | file://build/chromeos/OWNERS
2 |
--------------------------------------------------------------------------------
/build/config/compute_inputs_for_analyze.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2018 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | declare_args() {
6 | # Enable this flag when running "gn analyze".
7 | #
8 | # This causes some gn actions to compute inputs immediately (via exec_script)
9 | # where they would normally compute them only when executed (and write them to
10 | # a depfile).
11 | #
12 | # This flag will slow down GN, but is required for analyze to work properly.
13 | compute_inputs_for_analyze = false
14 | }
15 |
--------------------------------------------------------------------------------
/build/config/coverage/OWNERS:
--------------------------------------------------------------------------------
1 | pasthana@google.com
2 |
--------------------------------------------------------------------------------
/build/config/cronet/OWNERS:
--------------------------------------------------------------------------------
1 | file://components/cronet/OWNERS
2 |
--------------------------------------------------------------------------------
/build/config/cronet/config.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2022 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | declare_args() {
6 | # Control whether cronet is built (this is usually set by the script
7 | # components/cronet/tools/cr_cronet.py as cronet requires specific
8 | # gn args to build correctly).
9 | is_cronet_build = false
10 |
11 | # Controls whether cronet is currently being built for AOSP or Chromium.
12 | # This will always be false when building Cronet for Chromium.
13 | # the flag exists to accommodate for the divergence between the repos.
14 | is_cronet_for_aosp_build = false
15 | }
16 |
17 | if (is_cronet_for_aosp_build) {
18 | assert(
19 | is_cronet_build,
20 | "`is_cronet_for_aosp_build` flag can be only enabled when `is_cronet_build` flag is enabled.")
21 | }
22 |
--------------------------------------------------------------------------------
/build/config/cuttlefish/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2024 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/buildflag_header.gni")
6 | import("//build/config/cuttlefish/buildflags.gni")
7 |
8 | buildflag_header("buildflags") {
9 | header = "buildflags.h"
10 | flags = [ "PLATFORM_CUTTLEFISH=$is_cuttlefish" ]
11 | }
12 |
--------------------------------------------------------------------------------
/build/config/cuttlefish/README.md:
--------------------------------------------------------------------------------
1 | # Cuttlefish GN Build Flags
2 | Note: GN Flags are Build time flags
3 | You can get a comprehensive list of all arguments supported by gn by running the
4 | command gn args --list out/some-directory (the directory passed to gn args is
5 | required as gn args will invokes gn gen to generate the build.ninja files).
6 | ## is_cuttlefish (BUILDFLAG(PLATFORM_CUTTLEFISH))
7 | Flag for building chromium for Cuttlefish devices.
8 |
9 |
--------------------------------------------------------------------------------
/build/config/cuttlefish/buildflags.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2024 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | declare_args() {
6 | # True if building Cuttlefish devices.
7 | is_cuttlefish = false
8 | }
9 |
--------------------------------------------------------------------------------
/build/config/freetype/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2017 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/features.gni")
6 | import("//build/config/freetype/freetype.gni")
7 |
8 | group("freetype") {
9 | if (use_system_freetype) {
10 | public_configs = [ "//build/linux:freetype_from_pkgconfig" ]
11 | } else {
12 | public_deps = [ "//third_party:freetype_harfbuzz" ]
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/build/config/freetype/OWNERS:
--------------------------------------------------------------------------------
1 | bungeman@chromium.org
2 | drott@chromium.org
3 |
--------------------------------------------------------------------------------
/build/config/freetype/freetype.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2017 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | declare_args() {
6 | # Blink needs a recent and properly build-configured FreeType version to
7 | # support OpenType variations, color emoji and avoid security bugs. By default
8 | # we ship and link such a version as part of Chrome. For distributions that
9 | # prefer to keep linking to the version the system, FreeType must be newer
10 | # than version 2.7.1 and have color bitmap support compiled in. WARNING:
11 | # System FreeType configurations other than as described WILL INTRODUCE TEXT
12 | # RENDERING AND SECURITY REGRESSIONS.
13 | use_system_freetype = false
14 |
15 | # Use FreeType for font rendering. If this is set to false, FreeType is
16 | # replaced with the Rust-based Fontations set of libraries plus Skia
17 | # path rendering.
18 | enable_freetype = true
19 | }
20 |
--------------------------------------------------------------------------------
/build/config/fuchsia/DIR_METADATA:
--------------------------------------------------------------------------------
1 | mixins: "//build/fuchsia/COMMON_METADATA"
2 |
--------------------------------------------------------------------------------
/build/config/fuchsia/OWNERS:
--------------------------------------------------------------------------------
1 | file://build/fuchsia/OWNERS
2 |
3 | zijiehe@google.com
4 |
--------------------------------------------------------------------------------
/build/config/fuchsia/config.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2017 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | assert(is_fuchsia)
6 |
7 | # Compute the path to the arch-specific boot image directory.
8 | boot_image_root = "//third_party/fuchsia-sdk/images/"
9 |
--------------------------------------------------------------------------------
/build/config/fuchsia/extend_fvm.py:
--------------------------------------------------------------------------------
1 | # Copyright 2018 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | """Copies a FVM file and extends it by a specified amount.
6 |
7 | Arg #1: path to 'fvm'.
8 | #2: the path to the source fvm.blk.
9 | #3: the path that the extended FVM file will be written to.
10 | #4: the additional number of bytes to grow fvm.blk by."""
11 |
12 | import os
13 | import shutil
14 | import subprocess
15 | import sys
16 |
17 | def ExtendFVM(fvm_tool_path, src_path, dest_path, delta):
18 | old_size = os.path.getsize(src_path)
19 | new_size = old_size + int(delta)
20 | shutil.copyfile(src_path, dest_path)
21 | subprocess.check_call([fvm_tool_path, dest_path, 'extend', '--length',
22 | str(new_size)])
23 | return 0
24 |
25 | if __name__ == '__main__':
26 | sys.exit(ExtendFVM(*sys.argv[1:]))
27 |
--------------------------------------------------------------------------------
/build/config/fuchsia/packaged_content_embedder_excluded_dirs.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2022 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/devtools.gni")
6 |
7 | assert(is_fuchsia)
8 |
9 | # List of transitively included directories that should be stripped from
10 | # released packages for size reasons. For use with the |excluded_dirs| variable
11 | # of fuchsia_package().
12 | FUCHSIA_PACKAGED_CONTENT_EMBEDDER_EXCLUDED_DIRS = [
13 | # These are mistakenly being shipped in both PAK form and runtime data deps.
14 | # TODO(crbug.com/40203829): Remove when DevTools stops leaking its source list.
15 | devtools_root_location,
16 | ]
17 |
--------------------------------------------------------------------------------
/build/config/fuchsia/size_optimized_cast_receiver_args_internal.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2022 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | # This is a version of size_optimized_cast_receiver_args.gn that is intended for
6 | # internal builds and requires src-internal.
7 | #
8 | # To use it do one of the following:
9 | # * Add the following to your `gn args`:
10 | # import("build/config/fuchsia/size_optimized_cast_receiver_args_internal.gn")
11 | # * Add the following to `gn_args` in a bot recipe:
12 | # 'args_file': '//build/config/fuchsia/size_optimized_cast_receiver_args_internal.gn'
13 |
14 | import("//build/config/fuchsia/size_optimized_cast_receiver_args.gn")
15 |
16 | enable_widevine = true
17 | use_internal_isolated_origins = true
18 | use_official_google_api_keys = false
19 |
20 | # ThinLTO is enabled to reduce the binary size.
21 | use_thin_lto = true
22 |
--------------------------------------------------------------------------------
/build/config/fuchsia/test/OWNERS:
--------------------------------------------------------------------------------
1 | file://build/fuchsia/OWNERS
2 |
3 | per-file *.test-cml=set noparent
4 | per-file *.test-cml=ddorwin@chromium.org
5 | per-file *.test-cml=wez@chromium.org
6 | # Please prefer the above when possible.
7 | per-file *.test-cml=file://build/fuchsia/SECURITY_OWNERS
8 |
--------------------------------------------------------------------------------
/build/config/fuchsia/test/asan_options.shard.test-cml:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | {
5 | program: {
6 | // TODO(crbug.com/40276216): Remove the use of ASAN_OPTIONS once media does
7 | // not load the shared rust library separately.
8 | environ: [
9 | "ASAN_OPTIONS=detect_odr_violation=0",
10 | ]
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/build/config/fuchsia/test/audio_output.shard.test-cml:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | {
5 | use: [
6 | {
7 | protocol: [
8 | // TODO(crbug.com/40855135): Rather than require the system to provide
9 | // capabilities straight from audio_core, we should run Chromium tests
10 | // against an audio stack with fake device(s).
11 | "fuchsia.media.Audio",
12 | "fuchsia.media.AudioDeviceEnumerator",
13 | ]
14 | },
15 | ],
16 | }
17 |
--------------------------------------------------------------------------------
/build/config/fuchsia/test/chromium_system_test_facet.shard.test-cml:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | {
5 | facets: {
6 | "fuchsia.test": { type: "chromium-system" },
7 | },
8 | }
9 |
--------------------------------------------------------------------------------
/build/config/fuchsia/test/chromium_test_facet.shard.test-cml:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | {
5 | facets: {
6 | "fuchsia.test": { type: "chromium" },
7 | },
8 | }
9 |
--------------------------------------------------------------------------------
/build/config/fuchsia/test/context_provider.shard.test-cml:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | {
5 | children: [
6 | {
7 | name: "context_provider",
8 | url: "fuchsia-pkg://fuchsia.com/web_engine#meta/context_provider.cm",
9 | },
10 | ],
11 | use: [
12 | {
13 | protocol: [
14 | "fuchsia.web.ContextProvider",
15 | ],
16 | from: "#context_provider",
17 | dependency: "weak",
18 | },
19 | ],
20 | offer: [
21 | {
22 | protocol: [
23 | "fuchsia.feedback.ComponentDataRegister",
24 | "fuchsia.feedback.CrashReportingProductRegister",
25 | ],
26 | from: "parent",
27 | to: "#context_provider",
28 | },
29 | ],
30 | }
31 |
--------------------------------------------------------------------------------
/build/config/fuchsia/test/elf_test_ambient_exec_runner.shard.test-cml:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | {
5 | program: {
6 | runner: "elf_test_ambient_exec_runner",
7 | },
8 | capabilities: [
9 | { protocol: "fuchsia.test.Suite" },
10 | ],
11 | expose: [
12 | {
13 | protocol: "fuchsia.test.Suite",
14 | from: "self",
15 | },
16 | ],
17 | }
18 |
--------------------------------------------------------------------------------
/build/config/fuchsia/test/elf_test_runner.shard.test-cml:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | {
5 | program: {
6 | runner: "elf_test_runner",
7 | },
8 | capabilities: [
9 | { protocol: "fuchsia.test.Suite" },
10 | ],
11 | expose: [
12 | {
13 | protocol: "fuchsia.test.Suite",
14 | from: "self",
15 | },
16 | ],
17 | }
18 |
--------------------------------------------------------------------------------
/build/config/fuchsia/test/logger.shard.test-cml:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | {
5 | use: [
6 | { protocol: [ "fuchsia.logger.Log" ] },
7 | ],
8 | }
9 |
--------------------------------------------------------------------------------
/build/config/fuchsia/test/mark_vmo_executable.shard.test-cml:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | {
5 | use: [
6 | {
7 | protocol: [
8 | "fuchsia.kernel.VmexResource",
9 | ],
10 | },
11 | ],
12 | }
13 |
--------------------------------------------------------------------------------
/build/config/fuchsia/test/network.shard.test-cml:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | {
5 | use: [
6 | {
7 | directory: "root-ssl-certificates",
8 | rights: [ "r*" ],
9 | path: "/config/ssl",
10 | },
11 | {
12 | protocol: [
13 | "fuchsia.device.NameProvider", // Required by FDIO.
14 | "fuchsia.net.interfaces.State",
15 | "fuchsia.net.name.Lookup",
16 | "fuchsia.posix.socket.Provider",
17 | ],
18 | },
19 | ],
20 | }
21 |
--------------------------------------------------------------------------------
/build/config/fuchsia/test/sysmem.shard.test-cml:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | {
5 | use: [
6 | {
7 | protocol: [
8 | "fuchsia.sysmem.Allocator",
9 | "fuchsia.sysmem2.Allocator",
10 | ],
11 | },
12 | ],
13 | }
14 |
--------------------------------------------------------------------------------
/build/config/fuchsia/test/web_instance.shard.test-cml:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 | {
5 | include: [
6 | "//build/config/fuchsia/test/audio_output.shard.test-cml",
7 | "//build/config/fuchsia/test/fonts.shard.test-cml",
8 | "//build/config/fuchsia/test/mark_vmo_executable.shard.test-cml",
9 | "//build/config/fuchsia/test/network.shard.test-cml",
10 | "//build/config/fuchsia/test/platform_video_codecs.shard.test-cml",
11 | "//build/config/fuchsia/test/test_ui_stack.shard.test-cml",
12 | "vulkan/client.shard.cml",
13 | ],
14 | use: [
15 | {
16 | protocol: [
17 | "fuchsia.memorypressure.Provider",
18 | ],
19 | },
20 | ],
21 | }
22 |
--------------------------------------------------------------------------------
/build/config/gclient_args.gni:
--------------------------------------------------------------------------------
1 | # Generated from 'DEPS'
2 | # PATCH(build-gn): Customized.
3 | build_with_chromium = false
4 | checkout_android = false
5 | checkout_android_prebuilts_build_tools = false
6 | checkout_clang_coverage_tools = false
7 | checkout_copybara = false
8 | checkout_ios_webkit = false
9 | checkout_nacl = false
10 | checkout_openxr = true
11 | checkout_src_internal = false
12 | cros_boards = ""
13 | cros_boards_with_qemu_images = ""
14 | generate_location_tags = true
--------------------------------------------------------------------------------
/build/config/get_host_byteorder.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # Copyright 2017 The Chromium Authors
3 | # Use of this source code is governed by a BSD-style license that can be
4 | # found in the LICENSE file.
5 |
6 | """Get Byteorder of host architecture"""
7 |
8 |
9 | import sys
10 |
11 | print(sys.byteorder)
12 |
--------------------------------------------------------------------------------
/build/config/host_byteorder.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2017 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | # This header file defines the "host_byteorder" variable.
6 | # Not that this is currently used only for building v8.
7 | # The chromium code generally assumes little-endianness.
8 | declare_args() {
9 | host_byteorder = "undefined"
10 | }
11 |
12 | # Detect host byteorder
13 | # ppc64 can be either BE or LE
14 | if (host_cpu == "ppc64") {
15 | if (current_os == "aix") {
16 | host_byteorder = "big"
17 | } else {
18 | # Only use the script when absolutely necessary
19 | host_byteorder =
20 | exec_script("//build/config/get_host_byteorder.py", [], "trim string")
21 | }
22 | } else if (host_cpu == "ppc" || host_cpu == "s390" || host_cpu == "s390x" ||
23 | host_cpu == "mips" || host_cpu == "mips64") {
24 | host_byteorder = "big"
25 | } else {
26 | host_byteorder = "little"
27 | }
28 |
--------------------------------------------------------------------------------
/build/config/ios/Module-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | NSPrincipalClass
24 | ${XCTEST_BUNDLE_PRINCIPAL_CLASS}
25 |
26 |
27 |
--------------------------------------------------------------------------------
/build/config/ios/OWNERS:
--------------------------------------------------------------------------------
1 | file://build/apple/OWNERS
2 |
--------------------------------------------------------------------------------
/build/config/ios/bundle_data_from_filelist.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | assert(current_os == "ios")
6 |
7 | template("bundle_data_from_filelist") {
8 | assert(defined(invoker.filelist_name), "Requires setting filelist_name")
9 |
10 | _filelist_content = read_file(invoker.filelist_name, "list lines")
11 | bundle_data(target_name) {
12 | forward_variables_from(invoker,
13 | "*",
14 | [
15 | "filelist_name",
16 | "sources",
17 | ])
18 | sources = filter_exclude(_filelist_content, [ "#*" ])
19 | if (!defined(outputs)) {
20 | outputs = [ "{{bundle_resources_dir}}/" +
21 | "{{source_root_relative_dir}}/{{source_file_part}}" ]
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/build/config/ios/config.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2020 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/apple/mobile_config.gni")
6 |
7 | declare_args() {
8 | # Generate orderfile at application startup and then exit.
9 | # NOTE: This flag adds runtime tooling to capture function call details,
10 | # writes out an orderfile to the documents directory, then terminates the
11 | # application. It should generally NOT be enabled.
12 | ios_chrome_generate_order_file = false
13 | }
14 |
--------------------------------------------------------------------------------
/build/config/ios/entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | application-identifier
6 | $(AppIdentifierPrefix)$(CFBundleIdentifier)
7 | keychain-access-groups
8 |
9 | $(AppIdentifierPrefix)$(CFBundleIdentifier)
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/build/config/ios/ios_sdk_overrides.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2017 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | # This file contains arguments that subprojects may choose to override. It
6 | # asserts that those overrides are used, to prevent unused args warnings.
7 |
8 | import("//build/config/features.gni")
9 |
10 | declare_args() {
11 | # Version of iOS that we're targeting.
12 | if (use_blink) {
13 | ios_deployment_target = "17.4"
14 | } else {
15 | ios_deployment_target = "16.0"
16 | }
17 | }
18 |
19 | # Always assert that ios_deployment_target is used on non-iOS platforms to
20 | # prevent unused args warnings.
21 | if (!is_ios) {
22 | assert(ios_deployment_target == "16.0" || ios_deployment_target == "17.4" ||
23 | true)
24 | }
25 |
--------------------------------------------------------------------------------
/build/config/ios/resources/XCTRunnerAddition+Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleIdentifier
6 | ${BUNDLE_IDENTIFIER}
7 | CFBundleName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 |
12 |
13 |
--------------------------------------------------------------------------------
/build/config/ios/xctest_shell.mm:
--------------------------------------------------------------------------------
1 | // Copyright 2016 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #import
6 | #import
7 |
8 | // For Chrome on iOS we want to run EarlGrey tests (that are XCTests) for all
9 | // our build configurations (Debug, Release, ...). In addition, the symbols
10 | // visibility is configured to private by default. To simplify testing with
11 | // those constraints, our tests are compiled in the TEST_HOST target instead
12 | // of the .xctest bundle that all link against this single test (just there to
13 | // ensure that the bundle is not empty).
14 |
15 | @interface XCTestShellEmptyClass : NSObject
16 | @end
17 |
18 | @implementation XCTestShellEmptyClass
19 | @end
20 |
--------------------------------------------------------------------------------
/build/config/linux/OWNERS:
--------------------------------------------------------------------------------
1 | thomasanderson@chromium.org
2 |
--------------------------------------------------------------------------------
/build/config/linux/dbus/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/buildflag_header.gni")
6 | import("//build/config/features.gni")
7 | import("//build/config/linux/pkg_config.gni")
8 |
9 | buildflag_header("buildflags") {
10 | header = "buildflags.h"
11 | flags = [ "USE_DBUS=$use_dbus" ]
12 | }
13 |
14 | if (use_dbus) {
15 | # Note: if your target also depends on //dbus, you don't need to add this
16 | # config (it will get added automatically if you depend on //dbus).
17 | pkg_config("dbus") {
18 | packages = [ "dbus-1" ]
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/build/config/linux/dri/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2017 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/linux/pkg_config.gni")
6 |
7 | assert(is_linux, "This file should only be referenced on Linux")
8 |
9 | pkg_config("dri") {
10 | packages = [ "dri" ]
11 | dri_driver_dir = exec_script(pkg_config_script,
12 | common_pkg_config_args + pkg_config_args + [
13 | "--dridriverdir",
14 | "dri",
15 | ],
16 | "string")
17 | defines = [ "DRI_DRIVER_DIR=\"$dri_driver_dir\"" ]
18 | }
19 |
--------------------------------------------------------------------------------
/build/config/linux/gtk/gtk.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2018 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/ui.gni")
6 |
7 | declare_args() {
8 | # Whether or not we should use libgtk.
9 | use_gtk = is_linux && !is_castos
10 |
11 | # The (major) version of GTK to build against. A different version may be
12 | # loaded at runtime.
13 | gtk_version = 3
14 | }
15 |
--------------------------------------------------------------------------------
/build/config/linux/libffi/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/linux/pkg_config.gni")
6 |
7 | declare_args() {
8 | # Controls whether the build should use the version of libffi library shipped
9 | # with the system. By default, we only use the system version on Chrome OS:
10 | # on Linux, libffi must be statically linked to prevent a situation where the
11 | # runtime version of libffi is different from the build-time version from the
12 | # sysroot.
13 | use_system_libffi = default_toolchain == "//build/toolchain/cros:target"
14 | }
15 |
16 | if (use_system_libffi) {
17 | pkg_config("libffi") {
18 | packages = [ "libffi" ]
19 | }
20 | } else {
21 | config("libffi") {
22 | libs = [ "ffi_pic" ]
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/build/config/linux/libva/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2018 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/linux/pkg_config.gni")
6 |
7 | assert(is_linux || is_chromeos, "This file should only be referenced on Linux")
8 |
9 | pkg_config("libva") {
10 | packages = [ "libva" ]
11 |
12 | # Do not use exec_script to check the version here. It is done with a
13 | # static_assert instead.
14 |
15 | # vaapi decoders use dlopen pre-sandbox anyway to improve startup times.
16 | ignore_libs = true
17 | }
18 |
--------------------------------------------------------------------------------
/build/config/linux/nss/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2014 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/linux/pkg_config.gni")
6 |
7 | if (is_linux || is_chromeos) {
8 | # This is a dependency on NSS with no libssl3. On Linux and Chrome OS, we use
9 | # NSS for platform certificate integration. We use our own TLS library, so
10 | # exclude the one from NSS.
11 | pkg_config("nss") {
12 | packages = [ "nss" ]
13 | extra_args = [
14 | "-v",
15 | "-lssl3",
16 | ]
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/build/config/linux/pangocairo/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/linux/pangocairo/pangocairo.gni")
6 | import("//build/config/linux/pkg_config.gni")
7 |
8 | if (use_pangocairo) {
9 | pkg_config("pangocairo") {
10 | packages = [ "pangocairo" ]
11 |
12 | # We don't want pkgconfig for pangocairo to explicitly request FreeType to get
13 | # linked, because we control which FreeType to link to.
14 | extra_args = [
15 | "-v",
16 | "freetype",
17 | ]
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/build/config/linux/pangocairo/pangocairo.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2017 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/chromeos/ui_mode.gni")
6 | import("//build/config/ui.gni")
7 |
8 | declare_args() {
9 | use_pangocairo = is_linux && !is_castos
10 | }
11 |
--------------------------------------------------------------------------------
/build/config/logging.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2019 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/compiler/compiler.gni")
6 |
7 | declare_args() {
8 | # Stack traces will not include function names. Instead they will contain
9 | # file and offset information that can be used with
10 | # tools/valgrind/asan/asan_symbolize.py. By piping stderr through this script,
11 | # and also enabling symbol_level = 2, you can get much more detailed stack
12 | # traces with file names and line numbers, even in non-ASAN builds.
13 | print_unsymbolized_stack_traces = is_asan || is_lsan || is_msan || is_tsan
14 |
15 | # Enables the DWARF line number reader on Linux. This only has an effect if
16 | # print_unsymbolized_stack_traces is false.
17 | enable_stack_trace_line_numbers = symbol_level > 0
18 | }
19 |
--------------------------------------------------------------------------------
/build/config/loongarch64.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/v8_target_cpu.gni")
6 |
7 | if (current_cpu == "loong64") {
8 | declare_args() {
9 | # LOONGARCH64 SIMD Arch compilation flag.
10 | loongarch64_use_lsx = false
11 | loongarch64_use_lasx = false
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/build/config/mac/BuildInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | DTCompiler
6 | ${GCC_VERSION}
7 | DTSDKBuild
8 | ${MAC_SDK_BUILD}
9 | DTSDKName
10 | ${MAC_SDK_NAME}
11 | DTXcode
12 | ${XCODE_VERSION}
13 | DTXcodeBuild
14 | ${XCODE_BUILD}
15 |
16 |
17 |
--------------------------------------------------------------------------------
/build/config/mac/OWNERS:
--------------------------------------------------------------------------------
1 | file://build/apple/OWNERS
2 |
--------------------------------------------------------------------------------
/build/config/mac/mac_sdk_overrides.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2017 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | # This file contains arguments that subprojects may choose to override. It
6 | # asserts that those overrides are used, to prevent unused args warnings.
7 |
8 | _sdk_min_from_env = getenv("FORCE_MAC_SDK_MIN")
9 | declare_args() {
10 | # Minimum supported version of the Mac SDK.
11 | if (_sdk_min_from_env == "") {
12 | mac_sdk_min = "10.15"
13 | } else {
14 | mac_sdk_min = _sdk_min_from_env
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/build/config/nacl/host_toolchain.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2022 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | default_nacl_bootstrap_compiler = "g++"
6 | if (default_toolchain == "//build/toolchain/cros:target") {
7 | import("//build/toolchain/cros_toolchain.gni")
8 | if (target_cpu == "arm64" && current_cpu == "arm") {
9 | default_nacl_bootstrap_compiler = cros_nacl_helper_arm32_cxx
10 | } else {
11 | default_nacl_bootstrap_compiler = cros_target_cxx
12 | }
13 | } else if (current_cpu == "arm" && !is_android) {
14 | default_nacl_bootstrap_compiler = "arm-linux-gnueabihf-g++"
15 | } else if (current_cpu == "mipsel" && !is_android) {
16 | default_nacl_bootstrap_compiler = "mipsel-linux-gnu-g++"
17 | }
18 |
19 | declare_args() {
20 | # The compiler for the trusted nacl_helper_bootstrap binary.
21 | nacl_bootstrap_compiler = default_nacl_bootstrap_compiler
22 | }
23 |
--------------------------------------------------------------------------------
/build/config/pch.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/toolchain/cc_wrapper.gni")
6 | import("//build/toolchain/rbe.gni")
7 | import("//build/toolchain/siso.gni")
8 |
9 | declare_args() {
10 | # Precompiled header file support is by default available, except on the
11 | # following scenarios:
12 | # - Remote executions or when doing official builds.
13 | # - When using cc_wrapper because ccache requires a particular configuration
14 | # and some compiler options currently not used by Chromium:
15 | # https://ccache.dev/manual/latest.html#_precompiled_headers and it isn't
16 | # supported by sccache: https://github.com/mozilla/sccache/issues/978.
17 | # - On Linux it slows down the build.
18 | # PATCH(build-gn): pch is not supported yet.
19 | enable_precompiled_headers = false
20 | }
21 |
--------------------------------------------------------------------------------
/build/config/profiling/OWNERS:
--------------------------------------------------------------------------------
1 | pasthana@google.com
--------------------------------------------------------------------------------
/build/config/profiling/profiling.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2020 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/compiler/pgo/pgo.gni")
6 | import("//build/config/coverage/coverage.gni")
7 |
8 | declare_args() {
9 | use_clang_profiling =
10 | is_a_target_toolchain && (use_clang_coverage || chrome_pgo_phase == 1)
11 | }
12 |
13 | assert(!use_clang_profiling || is_clang,
14 | "Clang Source-based profiling requires clang.")
15 |
--------------------------------------------------------------------------------
/build/config/rts.gni:
--------------------------------------------------------------------------------
1 | declare_args() {
2 | # Regression Test Selection (RTS) will use a ML model
3 | # to predict what test cases can be excluded from a
4 | # given test suite based on historical data when using
5 | # a .filter file.
6 | use_rts = false
7 | }
8 |
--------------------------------------------------------------------------------
/build/config/sanitizers/OWNERS:
--------------------------------------------------------------------------------
1 | file://testing/libfuzzer/OWNERS
2 |
--------------------------------------------------------------------------------
/build/config/siso/.gitignore:
--------------------------------------------------------------------------------
1 | /.sisoenv
2 | /backend_config/backend.star
3 |
--------------------------------------------------------------------------------
/build/config/siso/DIR_METADATA:
--------------------------------------------------------------------------------
1 | team_email: "chrome-build-team@google.com"
2 | buganizer: {
3 | component_id: 1241816
4 | }
5 |
--------------------------------------------------------------------------------
/build/config/siso/OWNERS:
--------------------------------------------------------------------------------
1 | # All current members of the Chrome Build Team.
2 | jwata@google.com
3 | philwo@google.com
4 | richardwa@google.com
5 | tikuta@chromium.org
6 | ukai@google.com
7 |
--------------------------------------------------------------------------------
/build/config/siso/PRESUBMIT.py:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | PRESUBMIT_VERSION = '2.0.0'
6 |
7 |
8 | def CheckSisoConfigFormat(input_api, output_api):
9 | """Check if build/config/siso/*.star files are formatted correctly."""
10 | repo_root = input_api.change.RepositoryRoot()
11 | log_level = 'debug' if input_api.verbose else 'warning'
12 | commands = []
13 | for f in input_api.AffectedFiles():
14 | filepath = f.AbsoluteLocalPath()
15 | if not filepath.endswith('.star'):
16 | continue
17 | if not input_api.os_path.isfile(filepath):
18 | continue
19 | name = 'Validate ' + filepath
20 | cmd = ['lucicfg', 'fmt', '-dry-run', '-log-level', log_level, filepath]
21 | commands.append(input_api.Command(name, cmd, {}, output_api.PresubmitError))
22 | return input_api.RunTests(commands)
23 |
--------------------------------------------------------------------------------
/build/config/siso/README.md:
--------------------------------------------------------------------------------
1 | # Build config for Siso
2 |
3 | This directory contains configurations for
4 | [siso](https://chromium.googlesource.com/infra/infra/+/refs/heads/main/go/src/infra/build/siso/)
5 | build tool.
6 |
7 | Please refer to [the config specifications](https://chromium.googlesource.com/infra/infra/+/refs/heads/main/go/src/infra/build/siso/docs/starlark_config.md) in the Siso repo.
8 |
9 |
--------------------------------------------------------------------------------
/build/config/siso/backend_config/README.md:
--------------------------------------------------------------------------------
1 | # Backend config for Siso
2 |
3 | This directory contains backend specific config for
4 | [siso](https://chromium.googlesource.com/infra/infra/+/refs/heads/main/go/src/infra/build/siso/)
5 | build tool.
6 |
7 | User needs to add `backend.star` that provides `backend` module
8 | for `platform_properties` dict. The dict provides platform type
9 | as key (e.g. "default", "large"), and RBE properties (e.g.
10 | "container-image", "OSFamily" etc).
11 | Copy `template.star` to `backend.star` and edit property values.
12 |
--------------------------------------------------------------------------------
/build/config/siso/gn_logs.star:
--------------------------------------------------------------------------------
1 | # -*- bazel-starlark -*-
2 | # Copyright 2024 The Chromium Authors
3 | # Use of this source code is governed by a BSD-style license that can be
4 | # found in the LICENSE file.
5 | """gn_logs module to access gn_logs data."""
6 |
7 | load("@builtin//struct.star", "module")
8 |
9 | def __read(ctx):
10 | fname = ctx.fs.canonpath("./gn_logs.txt")
11 | if not ctx.fs.exists(fname):
12 | return {}
13 | gn_logs = ctx.fs.read(fname)
14 | vars = {}
15 | for line in str(gn_logs).splitlines():
16 | if line.startswith("#"):
17 | continue
18 | if not "=" in line:
19 | continue
20 | kv = line.split("=", 1)
21 | vars[kv[0].strip()] = kv[1].strip()
22 | return vars
23 |
24 | gn_logs = module(
25 | "gn_logs",
26 | read = __read,
27 | )
28 |
--------------------------------------------------------------------------------
/build/config/siso/platform.star:
--------------------------------------------------------------------------------
1 | # -*- bazel-starlark -*-
2 | # Copyright 2023 The Chromium Authors
3 | # Use of this source code is governed by a BSD-style license that can be
4 | # found in the LICENSE file.
5 | """Utilities that fill gap between platforms."""
6 |
7 | load("@builtin//runtime.star", "runtime")
8 | load("@builtin//struct.star", "module")
9 |
10 | # Python binary name. python3 or python3.exe.
11 | __python_bin = {
12 | # is_windows => python bin
13 | True: "python3.exe",
14 | False: "python3",
15 | }[runtime.os == "windows"]
16 |
17 | platform = module(
18 | "platform",
19 | python_bin = __python_bin,
20 | )
21 |
--------------------------------------------------------------------------------
/build/config/siso/windows.star:
--------------------------------------------------------------------------------
1 | # -*- bazel-starlark -*-
2 | # Copyright 2023 The Chromium Authors
3 | # Use of this source code is governed by a BSD-style license that can be
4 | # found in the LICENSE file.
5 | """Siso configuration for Windows."""
6 |
7 | load("@builtin//struct.star", "module")
8 | load("./clang_windows.star", "clang")
9 | load("./config.star", "config")
10 | load("./reproxy.star", "reproxy")
11 |
12 | def __filegroups(ctx):
13 | fg = {}
14 | fg.update(clang.filegroups(ctx))
15 | return fg
16 |
17 | __handlers = {}
18 | __handlers.update(clang.handlers)
19 |
20 | def __step_config(ctx, step_config):
21 | config.check(ctx)
22 | step_config = clang.step_config(ctx, step_config)
23 | return step_config
24 |
25 | chromium = module(
26 | "chromium",
27 | step_config = __step_config,
28 | filegroups = __filegroups,
29 | handlers = __handlers,
30 | )
31 |
--------------------------------------------------------------------------------
/build/config/unwind.gni:
--------------------------------------------------------------------------------
1 | import("//build_overrides/build.gni")
2 |
3 | declare_args() {
4 | # Use in-tree libunwind (buildtools/third_party/libunwind) instead of whatever
5 | # system library provides unwind symbols (e.g. libgcc).
6 | use_custom_libunwind = is_fuchsia || is_android
7 | }
8 |
--------------------------------------------------------------------------------
/build/config/win/console_app.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/sanitizers/sanitizers.gni")
6 |
7 | declare_args() {
8 | # If true, builds as a console app (rather than a windowed app), which allows
9 | # logging to be printed to the user. This will cause a terminal window to pop
10 | # up when the executable is not run from the command line, so should only be
11 | # used for development. Only has an effect on Windows builds.
12 | win_console_app = false
13 | }
14 |
15 | if (is_win && is_asan) {
16 | # AddressSanitizer build should be a console app since it writes to stderr.
17 | win_console_app = true
18 | }
19 |
--------------------------------------------------------------------------------
/build/config/win/control_flow_guard.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2020 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/sanitizers/sanitizers.gni")
6 |
7 | declare_args() {
8 | # Set this to true to enable generation of CFG indirect call dispatch
9 | # guards.
10 | win_enable_cfg_guards = !is_debug && !is_asan
11 | }
12 |
13 | if (win_enable_cfg_guards) {
14 | # Control Flow Guard (CFG)
15 | # https://msdn.microsoft.com/en-us/library/windows/desktop/mt637065.aspx
16 | # /DYNAMICBASE (ASLR) is turned off in debug builds, therefore CFG can't be
17 | # turned on either.
18 | # ASan and CFG leads to slow process startup. Chromium's test runner uses
19 | # lots of child processes, so this means things are really slow. Disable CFG
20 | # for now. https://crbug.com/846966
21 | assert(!is_debug && !is_asan,
22 | "CFG does not work well in debug builds or with ASAN")
23 | }
24 |
--------------------------------------------------------------------------------
/build/cp.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # Copyright 2012 The Chromium Authors
3 | # Use of this source code is governed by a BSD-style license that can be
4 | # found in the LICENSE file.
5 |
6 | """Copy a file.
7 |
8 | This module works much like the cp posix command - it takes 2 arguments:
9 | (src, dst) and copies the file with path |src| to |dst|.
10 | """
11 |
12 | import os
13 | import shutil
14 | import sys
15 |
16 |
17 | def Main(src, dst):
18 | # Use copy instead of copyfile to ensure the executable bit is copied.
19 | return shutil.copy(src, os.path.normpath(dst))
20 |
21 |
22 | if __name__ == '__main__':
23 | sys.exit(Main(sys.argv[1], sys.argv[2]))
24 |
--------------------------------------------------------------------------------
/build/dir_exists.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # Copyright 2011 The Chromium Authors
3 | # Use of this source code is governed by a BSD-style license that can be
4 | # found in the LICENSE file.
5 | """Writes True if the argument is a directory."""
6 |
7 | import os.path
8 | import sys
9 |
10 | def main():
11 | sys.stdout.write(_is_dir(sys.argv[1]))
12 | return 0
13 |
14 | def _is_dir(dir_name):
15 | return str(os.path.isdir(dir_name))
16 |
17 | def DoMain(args):
18 | """Hook to be called from gyp without starting a separate python
19 | interpreter."""
20 | return _is_dir(args[0])
21 |
22 | if __name__ == '__main__':
23 | sys.exit(main())
24 |
--------------------------------------------------------------------------------
/build/fuchsia/COMMON_METADATA:
--------------------------------------------------------------------------------
1 | monorail: {
2 | component: "Fuchsia"
3 | }
4 | team_email: "fuchsia-dev@chromium.org"
5 | os: FUCHSIA
6 | buganizer_public: {
7 | component_id: 1456675
8 | }
9 |
--------------------------------------------------------------------------------
/build/fuchsia/DIR_METADATA:
--------------------------------------------------------------------------------
1 | mixins: "//build/fuchsia/COMMON_METADATA"
2 |
--------------------------------------------------------------------------------
/build/fuchsia/OWNERS:
--------------------------------------------------------------------------------
1 | # When picking a reviewer for Fuchsia-related OWNERShip, please start by looking
2 | # at git history to find the most relevant owner. The team would appreciate it
3 | # if you would also add chromium-fuchsia-reviews@google.com so that a shadowed
4 | # reviewer is added automatically. Thank you.
5 |
6 | ddorwin@chromium.org
7 | sergeyu@chromium.org
8 | wez@chromium.org
9 | wintermelons@google.com
10 | zijiehe@google.com
11 |
12 | per-file linux_internal.sdk.sha1=chromium-internal-autoroll@skia-corp.google.com.iam.gserviceaccount.com
13 |
14 | per-file SECURITY_OWNERS=set noparent
15 | per-file SECURITY_OWNERS=file://build/fuchsia/SECURITY_OWNERS
16 |
--------------------------------------------------------------------------------
/build/fuchsia/SECURITY_OWNERS:
--------------------------------------------------------------------------------
1 | # Changes to integration with the Fuchsia platform, or peer components, require
2 | # security review to avoid introducing sandbox escapes. These include:
3 | # - Critical platform integrations (e.g. shared memory, process launching).
4 | # - Changes to Chromium-defined Fuchsia IPC (aka FIDL) protocols.
5 | # - Addition of new FIDL services to child process sandboxes.
6 | # - Addition of new FIDL clients and implementations.
7 | #
8 | # Security team: If you are uncomfortable reviewing a particular bit of code
9 | # yourself, don't hesitate to seek help from another security team member!
10 | # Nobody knows everything, and the only way to learn is from experience.
11 |
12 | # Please keep reviewers ordered alphabetically by LDAP.
13 | ajgo@chromium.org
14 | tsepez@chromium.org
15 | wez@chromium.org
16 |
--------------------------------------------------------------------------------
/build/fuchsia/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yue/build-gn/0b9681cd9ea457b2262f279be30e1fbd4ea81ebd/build/fuchsia/__init__.py
--------------------------------------------------------------------------------
/build/fuchsia/cipd/DIR_METADATA:
--------------------------------------------------------------------------------
1 | mixins: "//build/fuchsia/COMMON_METADATA"
2 |
--------------------------------------------------------------------------------
/build/fuchsia/cipd/README.md:
--------------------------------------------------------------------------------
1 | # CIPD recipes
2 |
3 | The `//build/fuchsia/cipd` target generates a number of YAML files that are used to
4 | produce archives that are uploaded to CIPD. The generated YAML files are stored
5 | in the output directory under the path `gen/build/fuchsia/cipd/`.
6 |
7 | ## Example usage
8 |
9 | The most recent package can be discovered by searching for the "canary" ref:
10 |
11 | `$ cipd describe chromium/fuchsia/$PACKAGE_NAME-$TARGET_ARCH -version canary`
12 |
--------------------------------------------------------------------------------
/build/fuchsia/cipd/version.template:
--------------------------------------------------------------------------------
1 | @MAJOR@.@MINOR@.@BUILD@.@PATCH@
--------------------------------------------------------------------------------
/build/fuchsia/gcs_download.py:
--------------------------------------------------------------------------------
1 | # Copyright 2022 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import os
6 | import sys
7 | import tarfile
8 | import tempfile
9 |
10 | sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),
11 | 'test')))
12 | from gs_util_wrapper import run_gsutil
13 |
14 | def DownloadAndUnpackFromCloudStorage(url, output_dir):
15 | """Fetches a tarball from GCS and uncompresses it to |output_dir|."""
16 |
17 | tmp_file = 'image.tgz'
18 | with tempfile.TemporaryDirectory() as tmp_d:
19 | tmp_file_location = os.path.join(tmp_d, tmp_file)
20 | run_gsutil(['cp', url, tmp_file_location])
21 | tarfile.open(name=tmp_file_location,
22 | mode='r|gz').extractall(path=output_dir)
23 |
--------------------------------------------------------------------------------
/build/fuchsia/linux_internal.sdk.sha1:
--------------------------------------------------------------------------------
1 | 26.20241213.101.1
2 |
--------------------------------------------------------------------------------
/build/fuchsia/sdk-bucket.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yue/build-gn/0b9681cd9ea457b2262f279be30e1fbd4ea81ebd/build/fuchsia/sdk-bucket.txt
--------------------------------------------------------------------------------
/build/fuchsia/test/.coveragerc:
--------------------------------------------------------------------------------
1 | # .coveragerc to control coverage.py
2 |
3 | [report]
4 | # Regexes for lines to exclude from consideration
5 | exclude_lines =
6 | # Don't complain if non-runnable code isn't run:
7 | if __name__ == .__main__.:
8 |
9 |
--------------------------------------------------------------------------------
/build/fuchsia/test/.style.yapf:
--------------------------------------------------------------------------------
1 | [style]
2 | based_on_style = pep8
3 |
--------------------------------------------------------------------------------
/build/fuchsia/test/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2024 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/python.gni")
6 |
7 | python_library("version") {
8 | data = [
9 | "//chrome/VERSION",
10 | "version.py",
11 | ]
12 | }
13 |
14 | python_library("gs_util_wrapper") {
15 | data = [
16 | "//build/find_depot_tools.py",
17 | "//third_party/depot_tools/",
18 | "gs_util_wrapper.py",
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/build/fuchsia/test/pylintrc:
--------------------------------------------------------------------------------
1 | [MESSAGES CONTROL]
2 |
3 | # Disable the message, report, category or checker with the given id(s).
4 | disable=fixme,
5 |
6 | # fixme
7 | # This complains about TODOs, which are perfectly valid to have.
8 |
9 | # Suppression for invalid-name error for PRESUBMIT.py file.
10 | good-names=i,j,k,f,PRESUBMIT
11 |
12 | [REPORTS]
13 |
14 | reports=no
15 |
16 | [DESIGN]
17 |
18 | # Maximum number of arguments for function / method
19 | max-args=6
20 |
21 | # Maximum number of instance attributes
22 | max-attributes=10
23 |
24 | [FORMAT]
25 |
26 | max-line-length=80
27 |
28 | [SIMILARITIES]
29 | ignore-comments=yes
30 | ignore-docstrings=yes
31 | ignore-imports=yes
32 |
--------------------------------------------------------------------------------
/build/get_symlink_targets.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # Copyright 2019 The Chromium Authors
3 | # Use of this source code is governed by a BSD-style license that can be
4 | # found in the LICENSE file.
5 | """Prints the target paths of the given symlinks.
6 |
7 | Prints out each target in the order that the links were passed in.
8 | """
9 |
10 | import os
11 | import sys
12 |
13 |
14 | def main():
15 | for link_name in sys.argv[1:]:
16 | if not os.path.islink(link_name):
17 | sys.stderr.write("%s is not a link" % link_name)
18 | return 1
19 | target = os.readlink(link_name)
20 | if not os.path.isabs(target):
21 | target = os.path.join(os.path.dirname(link_name), target)
22 | print(os.path.realpath(target))
23 | return 0
24 |
25 |
26 | if __name__ == '__main__':
27 | sys.exit(main())
28 |
--------------------------------------------------------------------------------
/build/gn_ast/.style.yapf:
--------------------------------------------------------------------------------
1 | [style]
2 | based_on_style = pep8
3 |
--------------------------------------------------------------------------------
/build/gn_ast/README.md:
--------------------------------------------------------------------------------
1 | # GN AST
2 |
3 | A Python library for working with GN files via abstract syntax tree (AST).
4 |
5 | ## JNI Refactor Example
6 |
7 | This library was originally created to perform the refactor within
8 | `jni_refactor.py`. The file is left as an example.
9 |
10 | ```sh
11 | # To apply to all files:
12 | find -name BUILD.gn > file-list.txt
13 | # To apply to those that match a pattern:
14 | grep -r --files-with-matches --include "BUILD.gn" "some pattern" > file-list.txt
15 |
16 | # To run one-at-a-time:
17 | for f in $(cat file-list.txt); do python3 jni_refactor.py "$f"; done
18 | # To run in parallel:
19 | parallel python3 jni_refactor.py -- $(cat file-list.txt)
20 | ```
21 |
--------------------------------------------------------------------------------
/build/gn_editor:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Copyright 2023 The Chromium Authors
3 | # Use of this source code is governed by a BSD-style license that can be
4 | # found in the LICENSE file.
5 |
6 | base_dir=$(dirname "$0")
7 |
8 | exec python3 "$base_dir/gn_ast/gn_editor.py" "$@"
9 |
--------------------------------------------------------------------------------
/build/install-build-deps.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | # Copyright 2012 The Chromium Authors
4 | # Use of this source code is governed by a BSD-style license that can be
5 | # found in the LICENSE file.
6 |
7 | exec "$(cd $(dirname $0) && pwd)/install-build-deps.py" "$@"
8 |
--------------------------------------------------------------------------------
/build/ios/OWNERS:
--------------------------------------------------------------------------------
1 | file://build/apple/OWNERS
2 |
--------------------------------------------------------------------------------
/build/ios/PRESUBMIT.py:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | PRESUBMIT_VERSION = '2.0.0'
6 |
7 |
8 | TEST_PATTERNS = [r'.+_test.py$']
9 |
10 |
11 | def CheckUnitTests(input_api, output_api):
12 | # Runs all unit tests under the build/ios folder.
13 | return input_api.canned_checks.RunUnitTestsInDirectory(
14 | input_api, output_api, '.', files_to_check=TEST_PATTERNS)
15 |
--------------------------------------------------------------------------------
/build/ios/test_data/bar.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yue/build-gn/0b9681cd9ea457b2262f279be30e1fbd4ea81ebd/build/ios/test_data/bar.html
--------------------------------------------------------------------------------
/build/ios/test_data/basic.filelist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 | # NOTE: this file is generated by build/ios/update_bundle_filelist.py
5 | # If it requires updating, you should get a presubmit error with
6 | # instructions on how to regenerate. Otherwise, do not edit.
7 | test_data/subdirectory/baz.txt
8 |
--------------------------------------------------------------------------------
/build/ios/test_data/basic.globlist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | test_data/subdirectory/*
6 |
--------------------------------------------------------------------------------
/build/ios/test_data/comment.filelist:
--------------------------------------------------------------------------------
1 | # This comment is an unexpected header.
2 | test_data/subdirectory/baz.txt
3 |
--------------------------------------------------------------------------------
/build/ios/test_data/comment.globlist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | # Some comment followed by an empty line.
6 |
7 | test_data/subdirectory/*
8 |
--------------------------------------------------------------------------------
/build/ios/test_data/different_local_path.filelist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 | # NOTE: this file is generated by build/ios/update_bundle_filelist.py
5 | # If it requires updating, you should get a presubmit error with
6 | # instructions on how to regenerate. Otherwise, do not edit.
7 | bar.html
8 | foo.css
9 | subdirectory/baz.txt
10 |
--------------------------------------------------------------------------------
/build/ios/test_data/different_local_path.globlist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | **
6 | -**list
7 |
--------------------------------------------------------------------------------
/build/ios/test_data/duplicates.filelist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 | # NOTE: this file is generated by build/ios/update_bundle_filelist.py
5 | # If it requires updating, you should get a presubmit error with
6 | # instructions on how to regenerate. Otherwise, do not edit.
7 | test_data/subdirectory/baz.txt
8 |
--------------------------------------------------------------------------------
/build/ios/test_data/duplicates.globlist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | test_data/subdirectory/*
6 | # This duplicate glob should have no effect on the resulting filelist.
7 | test_data/subdirectory/*
8 |
--------------------------------------------------------------------------------
/build/ios/test_data/exclusions.filelist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 | # NOTE: this file is generated by build/ios/update_bundle_filelist.py
5 | # If it requires updating, you should get a presubmit error with
6 | # instructions on how to regenerate. Otherwise, do not edit.
7 | test_data/bar.html
8 | test_data/foo.css
9 | test_data/subdirectory/baz.txt
10 |
--------------------------------------------------------------------------------
/build/ios/test_data/exclusions.globlist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | test_data/**
6 | -test_data/**list
7 |
--------------------------------------------------------------------------------
/build/ios/test_data/extra.filelist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 | # NOTE: this file is generated by build/ios/update_bundle_filelist.py
5 | # If it requires updating, you should get a presubmit error with
6 | # instructions on how to regenerate. Otherwise, do not edit.
7 | test_data/bar.html
8 | test_data/foo.css
9 |
--------------------------------------------------------------------------------
/build/ios/test_data/extra.globlist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | test_data/*.css
6 |
--------------------------------------------------------------------------------
/build/ios/test_data/foo.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yue/build-gn/0b9681cd9ea457b2262f279be30e1fbd4ea81ebd/build/ios/test_data/foo.css
--------------------------------------------------------------------------------
/build/ios/test_data/ignore_outside_globlist_dir.filelist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 | # NOTE: this file is generated by build/ios/update_bundle_filelist.py
5 | # If it requires updating, you should get a presubmit error with
6 | # instructions on how to regenerate. Otherwise, do not edit.
7 | presubmit_support_test.py
8 | test_data/subdirectory/baz.txt
9 |
--------------------------------------------------------------------------------
/build/ios/test_data/ignore_outside_globlist_dir.globlist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | test_data/subdirectory/*
6 | # push(ignore-relative)
7 | presubmit_support_test.py
8 | # pop(ignore-relative)
9 |
--------------------------------------------------------------------------------
/build/ios/test_data/missing.filelist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 | # NOTE: this file is generated by build/ios/update_bundle_filelist.py
5 | # If it requires updating, you should get a presubmit error with
6 | # instructions on how to regenerate. Otherwise, do not edit.
7 | test_data/bar.html
8 | test_data/foo.css
9 | test_data/subdirectory/baz.txt
10 |
--------------------------------------------------------------------------------
/build/ios/test_data/missing.globlist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | # This should cover every file in test_data/ and its subdirectories (including
6 | # test files).
7 |
8 | test_data/**
9 |
--------------------------------------------------------------------------------
/build/ios/test_data/outside_globlist_dir.filelist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 | # NOTE: this file is generated by build/ios/update_bundle_filelist.py
5 | # If it requires updating, you should get a presubmit error with
6 | # instructions on how to regenerate. Otherwise, do not edit.
7 | test_data/subdirectory/baz.txt
8 | presubmit_support_test.py
9 |
--------------------------------------------------------------------------------
/build/ios/test_data/outside_globlist_dir.globlist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | test_data/subdirectory/*
6 | presubmit_support_test.py
7 |
--------------------------------------------------------------------------------
/build/ios/test_data/reorder.filelist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 | # NOTE: this file is generated by build/ios/update_bundle_filelist.py
5 | # If it requires updating, you should get a presubmit error with
6 | # instructions on how to regenerate. Otherwise, do not edit.
7 | test_data/subdirectory/baz.txt
8 | test_data/foo.css
9 | test_data/bar.html
10 |
--------------------------------------------------------------------------------
/build/ios/test_data/reorder.globlist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | test_data/**
6 | -test_data/**list
7 |
--------------------------------------------------------------------------------
/build/ios/test_data/repository_relative.filelist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 | # NOTE: this file is generated by build/ios/update_bundle_filelist.py
5 | # If it requires updating, you should get a presubmit error with
6 | # instructions on how to regenerate. Otherwise, do not edit.
7 | //build/ios/test_data/bar.html
8 | //build/ios/test_data/foo.css
9 | //build/ios/test_data/subdirectory/baz.txt
10 |
--------------------------------------------------------------------------------
/build/ios/test_data/repository_relative.globlist:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | //build/ios/test_data/**
6 | -//build/ios/test_data/**list
7 |
--------------------------------------------------------------------------------
/build/ios/test_data/subdirectory/baz.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yue/build-gn/0b9681cd9ea457b2262f279be30e1fbd4ea81ebd/build/ios/test_data/subdirectory/baz.txt
--------------------------------------------------------------------------------
/build/landmine_utils.py:
--------------------------------------------------------------------------------
1 | # Copyright 2013 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 |
6 | import sys
7 |
8 |
9 | def IsWindows():
10 | return sys.platform in ['win32', 'cygwin']
11 |
12 |
13 | def IsLinux():
14 | return sys.platform.startswith(('linux', 'freebsd', 'netbsd', 'openbsd'))
15 |
16 |
17 | def IsMac():
18 | return sys.platform == 'darwin'
19 |
20 |
21 | def host_os():
22 | """
23 | Returns a string representing the host_os of the current system.
24 | Possible values: 'win', 'mac', 'linux', 'unknown'.
25 | """
26 | if IsWindows():
27 | return 'win'
28 | elif IsLinux():
29 | return 'linux'
30 | elif IsMac():
31 | return 'mac'
32 | else:
33 | return 'unknown'
34 |
--------------------------------------------------------------------------------
/build/linux/OWNERS:
--------------------------------------------------------------------------------
1 | mmoss@chromium.org
2 | thestig@chromium.org
3 | thomasanderson@chromium.org
4 |
--------------------------------------------------------------------------------
/build/linux/dump_app_syms.py:
--------------------------------------------------------------------------------
1 | # Copyright 2015 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | # Helper script to run dump_syms on Chrome Linux executables and strip
6 | # them if needed.
7 |
8 |
9 | import os
10 | import subprocess
11 | import sys
12 |
13 | if len(sys.argv) != 5:
14 | print("dump_app_syms.py ")
15 | print(" ")
16 | sys.exit(1)
17 |
18 | dumpsyms = sys.argv[1]
19 | strip_binary = sys.argv[2]
20 | infile = sys.argv[3]
21 | outfile = sys.argv[4]
22 |
23 | # Dump only when the output file is out-of-date.
24 | if not os.path.isfile(outfile) or \
25 | os.stat(outfile).st_mtime < os.stat(infile).st_mtime:
26 | with open(outfile, 'w') as outfileobj:
27 | subprocess.check_call([dumpsyms, '-m', '-d', infile], stdout=outfileobj)
28 |
29 | if strip_binary != '0':
30 | subprocess.check_call(['strip', infile])
31 |
--------------------------------------------------------------------------------
/build/linux/libncursesw/DIR_METADATA:
--------------------------------------------------------------------------------
1 | monorail: {
2 | component: "Internals>Accessibility"
3 | }
4 | team_email: "chromium-accessibility@chromium.org"
5 | buganizer_public: {
6 | component_id: 1456313
7 | }
8 |
--------------------------------------------------------------------------------
/build/linux/libncursesw/OWNERS:
--------------------------------------------------------------------------------
1 | file://ui/accessibility/OWNERS
2 |
--------------------------------------------------------------------------------
/build/linux/libpci/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//tools/generate_library_loader/generate_library_loader.gni")
6 |
7 | # This generates a target named "libpci".
8 | generate_library_loader("libpci") {
9 | name = "LibPciLoader"
10 | output_h = "libpci.h"
11 | output_cc = "libpci_loader.cc"
12 | header = ""
13 |
14 | functions = [
15 | "pci_alloc",
16 | "pci_init",
17 | "pci_cleanup",
18 | "pci_scan_bus",
19 | "pci_fill_info",
20 | "pci_lookup_name",
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/build/linux/sysroot_scripts/.style.yapf:
--------------------------------------------------------------------------------
1 | [style]
2 | based_on_style = pep8
3 |
--------------------------------------------------------------------------------
/build/linux/sysroot_scripts/keyring.gpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yue/build-gn/0b9681cd9ea457b2262f279be30e1fbd4ea81ebd/build/linux/sysroot_scripts/keyring.gpg
--------------------------------------------------------------------------------
/build/linux/sysroot_scripts/libxcomposite1-symbols:
--------------------------------------------------------------------------------
1 | libXcomposite.so.1 libxcomposite1 #MINVER#
2 | XCompositeCreateRegionFromBorderClip@Base 1:0.4.4-1
3 | XCompositeExtensionInfo@Base 1:0.4.4-1
4 | XCompositeExtensionName@Base 1:0.4.4-1
5 | XCompositeFindDisplay@Base 1:0.4.4-1
6 | XCompositeGetOverlayWindow@Base 1:0.4.4-1
7 | XCompositeNameWindowPixmap@Base 1:0.4.4-1
8 | XCompositeQueryExtension@Base 1:0.4.4-1
9 | XCompositeQueryVersion@Base 1:0.4.4-1
10 | XCompositeRedirectSubwindows@Base 1:0.4.4-1
11 | XCompositeRedirectWindow@Base 1:0.4.4-1
12 | XCompositeReleaseOverlayWindow@Base 1:0.4.4-1
13 | XCompositeUnredirectSubwindows@Base 1:0.4.4-1
14 | XCompositeUnredirectWindow@Base 1:0.4.4-1
15 | XCompositeVersion@Base 1:0.4.4-1
16 |
--------------------------------------------------------------------------------
/build/linux/sysroot_scripts/sysroot.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2024 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that
3 | # can be found in the LICENSE file.
4 |
5 | # This file was generated by
6 | # build/linux/sysroot_scripts/build_and_upload.py
7 |
8 | cr_sysroot_key = "20230611T210420Z-2"
9 |
--------------------------------------------------------------------------------
/build/linux/sysroot_scripts/update-archive-timestamp.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Copyright 2018 The Chromium Authors
3 | # Use of this source code is governed by a BSD-style license that can be
4 | # found in the LICENSE file.
5 |
6 | # This script updates sysroot_creator.py with the timestamp of the latest
7 | # snapshot from snapshot.debian.org.
8 |
9 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
10 | ARCHIVE_URL="http://snapshot.debian.org/archive/debian"
11 |
12 | # Use 9999-01-01 as the date so that we get a redirect to the page with the
13 | # latest timestamp.
14 | TIMESTAMP=$(curl -s "${ARCHIVE_URL}/99990101T000000Z/pool/" | \
15 | sed -n "s|.*${ARCHIVE_URL}/\([[:digit:]TZ]\+\)/pool/.*|\1|p" | head -n 1)
16 |
17 | sed -i "s/ARCHIVE_TIMESTAMP=.*$/ARCHIVE_TIMESTAMP=${TIMESTAMP}/" \
18 | "${SCRIPT_DIR}"/sysroot_creator.py
19 |
--------------------------------------------------------------------------------
/build/linux/unbundle/absl_algorithm.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 |
4 | pkg_config("system_absl_algorithm_container") {
5 | packages = [ "absl_algorithm_container" ]
6 | }
7 |
8 | shim_headers("container_shim") {
9 | root_path = "."
10 | prefix = "absl/algorithm/"
11 | headers = [ "container.h" ]
12 | }
13 |
14 | source_set("container") {
15 | deps = [ ":container_shim" ]
16 | public_configs = [ ":system_absl_algorithm_container" ]
17 | }
18 |
19 | source_set("algorithm_test") {
20 | }
21 | source_set("container_test") {
22 | }
23 |
--------------------------------------------------------------------------------
/build/linux/unbundle/absl_cleanup.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 |
4 | pkg_config("system_absl_cleanup") {
5 | packages = [ "absl_cleanup" ]
6 | }
7 |
8 | shim_headers("cleanup_shim") {
9 | root_path = "."
10 | prefix = "absl/cleanup/"
11 | headers = [ "cleanup.h" ]
12 | }
13 |
14 | source_set("cleanup") {
15 | deps = [ ":cleanup_shim" ]
16 | public_configs = [ ":system_absl_cleanup" ]
17 | }
18 |
19 | source_set("cleanup_test") {
20 | }
21 |
--------------------------------------------------------------------------------
/build/linux/unbundle/absl_crc.gn:
--------------------------------------------------------------------------------
1 | source_set("crc32c_test") {
2 | }
3 | source_set("crc_cord_state_test") {
4 | }
5 | source_set("crc_memcpy_test") {
6 | }
7 | source_set("non_temporal_memcpy_test") {
8 | }
9 |
--------------------------------------------------------------------------------
/build/linux/unbundle/absl_hash.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 |
4 | pkg_config("system_absl_hash") {
5 | packages = [ "absl_hash" ]
6 | }
7 |
8 | shim_headers("hash_shim") {
9 | root_path = "."
10 | prefix = "absl/hash/"
11 | headers = [ "hash.h" ]
12 | }
13 |
14 | source_set("hash") {
15 | deps = [ ":hash_shim" ]
16 | public_configs = [ ":system_absl_hash" ]
17 | }
18 |
19 | source_set("hash_instantiated_test") {
20 | }
21 | source_set("hash_test") {
22 | }
23 | source_set("low_level_hash_test") {
24 | }
25 |
--------------------------------------------------------------------------------
/build/linux/unbundle/absl_log_internal.gn:
--------------------------------------------------------------------------------
1 | source_set("fnmatch_test") {
2 | }
3 | source_set("stderr_log_sink_test") {
4 | }
5 |
--------------------------------------------------------------------------------
/build/linux/unbundle/absl_memory.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 |
4 | pkg_config("system_absl_memory") {
5 | packages = [ "absl_memory" ]
6 | }
7 |
8 | shim_headers("memory_shim") {
9 | root_path = "."
10 | prefix = "absl/memory/"
11 | headers = [ "memory.h" ]
12 | }
13 |
14 | source_set("memory") {
15 | deps = [ ":memory_shim" ]
16 | public_configs = [ ":system_absl_memory" ]
17 | }
18 |
19 | source_set("memory_test") {
20 | }
21 |
--------------------------------------------------------------------------------
/build/linux/unbundle/absl_meta.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 |
4 | pkg_config("system_absl_type_traits") {
5 | packages = [ "absl_type_traits" ]
6 | }
7 |
8 | shim_headers("type_traits_shim") {
9 | root_path = "."
10 | prefix = "absl/meta/"
11 | headers = [ "type_traits.h" ]
12 | }
13 |
14 | source_set("type_traits") {
15 | deps = [ ":type_traits_shim" ]
16 | public_configs = [ ":system_absl_type_traits" ]
17 | }
18 |
19 | source_set("type_traits_test") {
20 | }
21 |
--------------------------------------------------------------------------------
/build/linux/unbundle/absl_numeric.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 |
4 | pkg_config("system_absl_bits") {
5 | packages = [ "absl_bits" ]
6 | }
7 |
8 | pkg_config("system_absl_int128") {
9 | packages = [ "absl_int128" ]
10 | }
11 |
12 | shim_headers("bits_shim") {
13 | root_path = "."
14 | prefix = "absl/numeric/"
15 | headers = [ "bits.h" ]
16 | }
17 |
18 | source_set("bits") {
19 | deps = [ ":bits_shim" ]
20 | public_configs = [ ":system_absl_bits" ]
21 | }
22 |
23 | shim_headers("int128_shim") {
24 | root_path = "."
25 | prefix = "absl/numeric/"
26 | headers = [ "int128.h" ]
27 | }
28 |
29 | source_set("int128") {
30 | deps = [ ":int128_shim" ]
31 | public_configs = [ ":system_absl_int128" ]
32 | }
33 |
34 | source_set("int128_test") {
35 | }
36 |
--------------------------------------------------------------------------------
/build/linux/unbundle/absl_status.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 |
4 | pkg_config("system_absl_status") {
5 | packages = [ "absl_status" ]
6 | }
7 |
8 | pkg_config("system_absl_statusor") {
9 | packages = [ "absl_statusor" ]
10 | }
11 |
12 | shim_headers("status_shim") {
13 | root_path = "."
14 | prefix = "absl/status/"
15 | headers = [
16 | "status.h",
17 | "status_payload_printer.h",
18 | ]
19 | }
20 |
21 | source_set("status") {
22 | deps = [ ":status_shim" ]
23 | public_configs = [ ":system_absl_status" ]
24 | }
25 |
26 | shim_headers("statusor_shim") {
27 | root_path = "."
28 | prefix = "absl/status/"
29 | headers = [ "statusor.h" ]
30 | }
31 |
32 | source_set("statusor") {
33 | deps = [ ":statusor_shim" ]
34 | public_configs = [ ":system_absl_statusor" ]
35 | }
36 |
37 | source_set("status_test") {
38 | }
39 | source_set("statusor_test") {
40 | }
41 | source_set("status_matchers_test") {
42 | }
43 |
--------------------------------------------------------------------------------
/build/linux/unbundle/absl_synchronization.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 |
4 | pkg_config("system_absl_synchronization") {
5 | packages = [ "absl_synchronization" ]
6 | }
7 |
8 | shim_headers("synchronization_shim") {
9 | root_path = "."
10 | prefix = "absl/synchronization/"
11 | headers = [
12 | "barrier.h",
13 | "blocking_counter.h",
14 | "mutex.h",
15 | "notification.h",
16 | ]
17 | }
18 |
19 | source_set("synchronization") {
20 | deps = [ ":synchronization_shim" ]
21 | public_configs = [ ":system_absl_synchronization" ]
22 | }
23 |
24 | source_set("kernel_timeout_internal_test") {
25 | }
26 | source_set("waiter_test") {
27 | }
28 |
--------------------------------------------------------------------------------
/build/linux/unbundle/absl_time.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 |
4 | pkg_config("system_absl_time") {
5 | packages = [ "absl_time" ]
6 | }
7 |
8 | shim_headers("time_shim") {
9 | root_path = "."
10 | prefix = "absl/time/"
11 | headers = [
12 | "civil_time.h",
13 | "clock.h",
14 | "time.h",
15 | ]
16 | }
17 |
18 | source_set("time") {
19 | deps = [ ":time_shim" ]
20 | public_configs = [ ":system_absl_time" ]
21 | }
22 |
23 | source_set("time_test") {
24 | }
25 |
--------------------------------------------------------------------------------
/build/linux/unbundle/absl_utility.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 |
4 | pkg_config("system_absl_utility") {
5 | packages = [ "absl_utility" ]
6 | }
7 |
8 | shim_headers("utility_shim") {
9 | root_path = "."
10 | prefix = "absl/utility/"
11 | headers = [ "utility.h" ]
12 | }
13 |
14 | source_set("utility") {
15 | deps = [ ":utility_shim" ]
16 | public_configs = [ ":system_absl_utility" ]
17 | }
18 |
19 | source_set("if_constexpr_test") {
20 | }
21 |
--------------------------------------------------------------------------------
/build/linux/unbundle/brotli.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 |
4 | pkg_config("system_brotli_dec") {
5 | packages = [ "libbrotlidec" ]
6 | }
7 |
8 | pkg_config("system_brotli_enc") {
9 | packages = [ "libbrotlienc" ]
10 | }
11 |
12 | shim_headers("brotli_shim") {
13 | root_path = "include"
14 | headers = [
15 | "brotli/decode.h",
16 | "brotli/encode.h",
17 | "brotli/port.h",
18 | "brotli/shared_dictionary.h",
19 | "brotli/types.h",
20 | ]
21 | }
22 |
23 | source_set("dec") {
24 | deps = [ ":brotli_shim" ]
25 | public_configs = [ ":system_brotli_dec" ]
26 | }
27 |
28 | source_set("enc") {
29 | deps = [ ":brotli_shim" ]
30 | public_configs = [ ":system_brotli_enc" ]
31 | }
32 |
33 | copy("brotli") {
34 | sources = [ "/usr/bin/brotli" ]
35 | outputs = [ "$root_out_dir/brotli" ]
36 | }
37 |
--------------------------------------------------------------------------------
/build/linux/unbundle/crc32c.gn:
--------------------------------------------------------------------------------
1 | import("//build/shim_headers.gni")
2 |
3 | shim_headers("crc32c_shim") {
4 | root_path = "src/include"
5 | headers = [ "crc32c/crc32c.h" ]
6 | }
7 |
8 | source_set("crc32c") {
9 | deps = [ ":crc32c_shim" ]
10 | libs = [ "crc32c" ]
11 | }
12 |
--------------------------------------------------------------------------------
/build/linux/unbundle/dav1d.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 |
4 | pkg_config("system_dav1d") {
5 | packages = [ "dav1d" ]
6 | }
7 |
8 | shim_headers("dav1d_shim") {
9 | root_path = "libdav1d/include"
10 | headers = [
11 | "dav1d/common.h",
12 | "dav1d/data.h",
13 | "dav1d/dav1d.h",
14 | "dav1d/headers.h",
15 | "dav1d/picture.h",
16 | "dav1d/version.h",
17 | ]
18 | }
19 |
20 | source_set("dav1d") {
21 | deps = [ ":dav1d_shim" ]
22 | public_configs = [ ":system_dav1d" ]
23 | }
24 |
25 | group("dav1d_headers") {
26 | public_deps = [ ":dav1d_shim" ]
27 | }
28 |
29 | config("dav1d_config") {
30 | configs = [
31 | ":system_dav1d",
32 | ":dav1d_shim_config",
33 | ]
34 | }
35 |
--------------------------------------------------------------------------------
/build/linux/unbundle/double-conversion.gn:
--------------------------------------------------------------------------------
1 | import("//build/shim_headers.gni")
2 |
3 | shim_headers("double_conversion_shim") {
4 | root_path = "."
5 | headers = [
6 | "double-conversion/bignum.h",
7 | "double-conversion/cached-powers.h",
8 | "double-conversion/diy-fp.h",
9 | "double-conversion/double-conversion.h",
10 | "double-conversion/double-to-string.h",
11 | "double-conversion/fast-dtoa.h",
12 | "double-conversion/fixed-dtoa.h",
13 | "double-conversion/ieee.h",
14 | "double-conversion/string-to-double.h",
15 | "double-conversion/strtod.h",
16 | "double-conversion/utils.h",
17 | ]
18 | }
19 |
20 | source_set("double_conversion") {
21 | deps = [ ":double_conversion_shim" ]
22 | libs = [ "double-conversion" ]
23 | }
24 |
--------------------------------------------------------------------------------
/build/linux/unbundle/ffmpeg.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/buildflag_header.gni")
6 | import("//build/config/linux/pkg_config.gni")
7 | import("//build/shim_headers.gni")
8 |
9 | pkg_config("system_ffmpeg") {
10 | packages = [
11 | "libavcodec",
12 | "libavformat",
13 | "libavutil",
14 | ]
15 | }
16 |
17 | buildflag_header("ffmpeg_features") {
18 | header = "ffmpeg_features.h"
19 | flags = [ "USE_SYSTEM_FFMPEG=true" ]
20 | }
21 |
22 | shim_headers("ffmpeg_shim") {
23 | root_path = "."
24 | headers = [
25 | "libavcodec/avcodec.h",
26 | "libavcodec/packet.h",
27 | "libavformat/avformat.h",
28 | "libavutil/imgutils.h",
29 | ]
30 | }
31 |
32 | source_set("ffmpeg") {
33 | deps = [
34 | ":ffmpeg_features",
35 | ":ffmpeg_shim",
36 | ]
37 | public_configs = [ ":system_ffmpeg" ]
38 | }
39 |
--------------------------------------------------------------------------------
/build/linux/unbundle/flac.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/linux/pkg_config.gni")
6 | import("//build/shim_headers.gni")
7 |
8 | pkg_config("system_flac") {
9 | packages = [ "flac" ]
10 | }
11 |
12 | shim_headers("flac_shim") {
13 | root_path = "include"
14 | headers = [
15 | "FLAC/all.h",
16 | "FLAC/assert.h",
17 | "FLAC/callback.h",
18 | "FLAC/export.h",
19 | "FLAC/format.h",
20 | "FLAC/metadata.h",
21 | "FLAC/ordinals.h",
22 | "FLAC/stream_decoder.h",
23 | "FLAC/stream_encoder.h",
24 | ]
25 | }
26 |
27 | source_set("flac") {
28 | deps = [ ":flac_shim" ]
29 | public_configs = [ ":system_flac" ]
30 | }
31 |
--------------------------------------------------------------------------------
/build/linux/unbundle/flatbuffers.gn:
--------------------------------------------------------------------------------
1 | import("//build/shim_headers.gni")
2 |
3 |
4 | config("flatbuffers_config") {
5 | include_dirs = [ "src/include" ]
6 |
7 | # Required to prevent static initialization of locale
8 | # in util.cpp
9 | defines = [ "FLATBUFFERS_LOCALE_INDEPENDENT=0" ]
10 | }
11 |
12 | shim_headers("flatbuffers_shim") {
13 | root_path = "src/include"
14 | headers = [
15 | "flatbuffers/base.h",
16 | "flatbuffers/flatbuffers.h",
17 | "flatbuffers/stl_emulation.h",
18 | "flatbuffers/flexbuffers.h",
19 | "flatbuffers/util.h",
20 | ]
21 | }
22 |
23 | source_set("flatbuffers") {
24 | deps = [ ":flatbuffers_shim" ]
25 | libs = [ "flatbuffers" ]
26 | public_configs = [ ":flatbuffers_config" ]
27 | }
28 |
29 | copy("flatc") {
30 | sources = [ "/usr/bin/flatc" ]
31 | outputs = [ "$root_out_dir/flatc" ]
32 | }
33 |
34 | source_set("flatbuffers_unittests") {}
--------------------------------------------------------------------------------
/build/linux/unbundle/fontconfig.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2017 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | assert(is_linux || is_chromeos)
6 |
7 | config("fontconfig_config") {
8 | libs = [ "fontconfig" ]
9 | }
10 |
11 | group("fontconfig") {
12 | public_configs = [ ":fontconfig_config" ]
13 | }
14 |
--------------------------------------------------------------------------------
/build/linux/unbundle/freetype.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2017 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | declare_args() {
6 | # Blink needs a recent and properly build-configured FreeType version to
7 | # support OpenType variations, color emoji and avoid security bugs. By default
8 | # we ship and link such a version as part of Chrome. For distributions that
9 | # prefer to keep linking to the version the system, FreeType must be newer
10 | # than version 2.7.1 and have color bitmap support compiled in. WARNING:
11 | # System FreeType configurations other than as described WILL INTRODUCE TEXT
12 | # RENDERING AND SECURITY REGRESSIONS.
13 | use_system_freetype = true
14 |
15 | # Use FreeType for font rendering. If this is set to false, FreeType is
16 | # replaced with the Rust-based Fontations set of libraries plus Skia
17 | # path rendering.
18 | enable_freetype = true
19 | }
20 |
--------------------------------------------------------------------------------
/build/linux/unbundle/harfbuzz-ng.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2017 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | declare_args() {
6 | # Blink uses a cutting-edge version of Harfbuzz (version listed in
7 | # third_party/harfbuzz-ng/README.chromium); most Linux distros do not contain
8 | # a new enough version of the code to work correctly. However, ChromeOS
9 | # chroots (i.e. real ChromeOS builds for devices) do contain a new enough
10 | # version of the library, and so this variable exists so that ChromeOS can
11 | # build against the system lib and keep binary sizes smaller.
12 | use_system_harfbuzz = true
13 | }
14 |
--------------------------------------------------------------------------------
/build/linux/unbundle/highway.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 | import("src/hwy.gni")
4 |
5 | pkg_config("libhwy_external_config") {
6 | packages = [ "libhwy" ]
7 | }
8 |
9 | shim_headers("libhwy_shim") {
10 | root_path = "src"
11 | headers = []
12 | foreach(header, hwy_public) {
13 | headers += [ rebase_path(header, "./src") ]
14 | }
15 | }
16 |
17 | source_set("libhwy") {
18 | public_configs = [ ":libhwy_external_config" ]
19 | public_deps = [ ":libhwy_shim" ]
20 | }
21 |
--------------------------------------------------------------------------------
/build/linux/unbundle/jsoncpp.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 |
4 | pkg_config("jsoncpp_config") {
5 | packages = [ "jsoncpp" ]
6 |
7 | # Defining JSON_DLL_BUILD applies public visibility to jsoncpp classes
8 | # thus deactivating CFI checks for them. This avoids CFI violations in
9 | # virtual calls to system jsoncpp library (https://crbug.com/1365218).
10 | defines = [ "JSON_DLL_BUILD" ]
11 | }
12 |
13 | shim_headers("jsoncpp_shim") {
14 | root_path = "source/include"
15 | headers = [
16 | "json/allocator.h",
17 | "json/assertions.h",
18 | "json/config.h",
19 | "json/forwards.h",
20 | "json/json.h",
21 | "json/json_features.h",
22 | "json/reader.h",
23 | "json/value.h",
24 | "json/version.h",
25 | "json/writer.h",
26 | ]
27 | }
28 |
29 | source_set("jsoncpp") {
30 | deps = [ ":jsoncpp_shim" ]
31 | public_configs = [ ":jsoncpp_config" ]
32 | }
33 |
--------------------------------------------------------------------------------
/build/linux/unbundle/libXNVCtrl.gn:
--------------------------------------------------------------------------------
1 | import("//build/shim_headers.gni")
2 |
3 | shim_headers("libXNVCtrl_shim") {
4 | root_path = "../../../../../third_party/libXNVCtrl"
5 | prefix = "NVCtrl/"
6 | headers = [
7 | "NVCtrl.h",
8 | "NVCtrlLib.h",
9 | "nv_control.h",
10 | ]
11 | }
12 |
13 | source_set("libXNVCtrl") {
14 | deps = [ ":libXNVCtrl_shim" ]
15 | libs = [
16 | "XNVCtrl",
17 | "xcb",
18 | ]
19 | }
20 |
--------------------------------------------------------------------------------
/build/linux/unbundle/libaom.gn:
--------------------------------------------------------------------------------
1 | import("//build/buildflag_header.gni")
2 | import("//build/config/linux/pkg_config.gni")
3 | import("//build/shim_headers.gni")
4 | import("//third_party/libaom/options.gni")
5 |
6 | buildflag_header("libaom_buildflags") {
7 | header = "libaom_buildflags.h"
8 | flags = [ "ENABLE_LIBAOM=$enable_libaom" ]
9 | }
10 |
11 | pkg_config("system_aom") {
12 | packages = [ "aom" ]
13 | }
14 |
15 | shim_headers("aom_shim") {
16 | root_path = "source/libaom"
17 | headers = [
18 | "aom/aom.h",
19 | "aom/aom_codec.h",
20 | "aom/aom_decoder.h",
21 | "aom/aom_encoder.h",
22 | "aom/aom_external_partition.h",
23 | "aom/aom_frame_buffer.h",
24 | "aom/aom_image.h",
25 | "aom/aom_integer.h",
26 | "aom/aomcx.h",
27 | "aom/aomdx.h",
28 | ]
29 | }
30 |
31 | source_set("libaom") {
32 | deps = [ ":aom_shim" ]
33 | public_configs = [ ":system_aom" ]
34 | }
35 |
--------------------------------------------------------------------------------
/build/linux/unbundle/libavif.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 |
4 | pkg_config("system_libavif") {
5 | packages = [ "libavif" ]
6 | }
7 |
8 | shim_headers("avif_shim") {
9 | root_path = "src/include"
10 | headers = [ "avif/avif.h" ]
11 | }
12 |
13 | source_set("libavif") {
14 | deps = [ ":avif_shim" ]
15 | public_configs = [ ":system_libavif" ]
16 | }
17 |
--------------------------------------------------------------------------------
/build/linux/unbundle/libdrm.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2017 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/linux/pkg_config.gni")
6 | import("//build/shim_headers.gni")
7 |
8 | pkg_config("system_libdrm") {
9 | packages = [ "libdrm" ]
10 | }
11 |
12 | shim_headers("libdrm_shim") {
13 | root_path = "src/include"
14 | headers = [ "drm.h" ]
15 | }
16 |
17 | source_set("libdrm") {
18 | deps = [ ":libdrm_shim" ]
19 | public_configs = [ ":system_libdrm" ]
20 | }
21 |
--------------------------------------------------------------------------------
/build/linux/unbundle/libevent.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/shim_headers.gni")
6 |
7 | shim_headers("libevent_shim") {
8 | root_path = "."
9 | headers = [ "event.h" ]
10 | }
11 |
12 | source_set("libevent") {
13 | deps = [ ":libevent_shim" ]
14 | libs = [ "event" ]
15 | }
16 |
--------------------------------------------------------------------------------
/build/linux/unbundle/libjpeg.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2018 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | declare_args() {
6 | # Uses system libjpeg. If true, overrides use_libjpeg_turbo.
7 | use_system_libjpeg = true
8 |
9 | # Uses libjpeg_turbo as the jpeg implementation. Has no effect if
10 | # use_system_libjpeg is set.
11 | use_libjpeg_turbo = true
12 | }
13 |
--------------------------------------------------------------------------------
/build/linux/unbundle/libpng.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/linux/pkg_config.gni")
6 | import("//build/shim_headers.gni")
7 |
8 | pkg_config("libpng_config") {
9 | packages = [ "libpng" ]
10 | }
11 |
12 | shim_headers("libpng_shim") {
13 | root_path = "."
14 | headers = [
15 | "png.h",
16 | "pngconf.h",
17 | ]
18 | }
19 |
20 | source_set("libpng") {
21 | deps = [ ":libpng_shim" ]
22 | public_configs = [ ":libpng_config" ]
23 | }
24 |
--------------------------------------------------------------------------------
/build/linux/unbundle/libsecret.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 |
3 | pkg_config("libsecret_config") {
4 | packages = [ "libsecret-1" ]
5 | }
6 |
7 | source_set("libsecret") {
8 | public_configs = [ ":libsecret_config" ]
9 | }
10 |
--------------------------------------------------------------------------------
/build/linux/unbundle/libusb.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 |
4 | pkg_config("system_libusb") {
5 | packages = [ "libusb-1.0" ]
6 | }
7 |
8 | shim_headers("libusb_shim") {
9 | root_path = "src/libusb"
10 | headers = [
11 | "libusb.h",
12 | ]
13 | }
14 |
15 | source_set("libusb") {
16 | deps = [
17 | ":libusb_shim",
18 | ]
19 | public_configs = [ ":system_libusb" ]
20 | }
21 |
--------------------------------------------------------------------------------
/build/linux/unbundle/libvpx.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/linux/pkg_config.gni")
6 | import("//build/shim_headers.gni")
7 |
8 | pkg_config("system_libvpx") {
9 | packages = [ "vpx" ]
10 | }
11 |
12 | shim_headers("libvpx_shim") {
13 | root_path = "source/libvpx"
14 | headers = [
15 | "vpx/vp8.h",
16 | "vpx/vp8cx.h",
17 | "vpx/vp8dx.h",
18 | "vpx/vpx_codec.h",
19 | "vpx/vpx_codec_impl_bottom.h",
20 | "vpx/vpx_codec_impl_top.h",
21 | "vpx/vpx_decoder.h",
22 | "vpx/vpx_encoder.h",
23 | "vpx/vpx_frame_buffer.h",
24 | "vpx/vpx_image.h",
25 | "vpx/vpx_integer.h",
26 | ]
27 | }
28 |
29 | source_set("libvpx") {
30 | deps = [ ":libvpx_shim" ]
31 | public_configs = [ ":system_libvpx" ]
32 | }
33 |
--------------------------------------------------------------------------------
/build/linux/unbundle/libxslt.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/linux/pkg_config.gni")
6 |
7 | pkg_config("system_libxslt") {
8 | packages = [ "libxslt" ]
9 | }
10 |
11 | source_set("libxslt") {
12 | public_configs = [ ":system_libxslt" ]
13 | }
14 |
--------------------------------------------------------------------------------
/build/linux/unbundle/openh264_encoder_cfi_ignores.txt:
--------------------------------------------------------------------------------
1 | [cfi-vcall]
2 | type:ISVCEncoder
3 |
--------------------------------------------------------------------------------
/build/linux/unbundle/opus.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2017 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/linux/pkg_config.gni")
6 | import("//build/shim_headers.gni")
7 |
8 | pkg_config("opus_config") {
9 | packages = [ "opus" ]
10 | }
11 |
12 | shim_headers("opus_shim") {
13 | root_path = "src/include"
14 | headers = [
15 | "opus.h",
16 | "opus_defines.h",
17 | "opus_multistream.h",
18 | "opus_types.h",
19 | ]
20 | }
21 |
22 | source_set("opus") {
23 | deps = [ ":opus_shim" ]
24 | public_configs = [ ":opus_config" ]
25 | }
26 |
27 | source_set("opus_compare") {
28 | }
29 |
30 | source_set("opus_demo") {
31 | }
32 |
33 | source_set("test_opus_api") {
34 | }
35 |
36 | source_set("test_opus_decode") {
37 | }
38 |
39 | source_set("test_opus_encode") {
40 | }
41 |
42 | source_set("test_opus_padding") {
43 | }
44 |
--------------------------------------------------------------------------------
/build/linux/unbundle/re2.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/c++/c++.gni")
6 | import("//build/config/linux/pkg_config.gni")
7 | import("//build/shim_headers.gni")
8 |
9 | assert(!use_custom_libcxx,
10 | "Usage of the system libre2.so is not supported with " +
11 | "use_custom_libcxx=true because the library's interface relies on " +
12 | "libstdc++'s std::string and std::vector.")
13 |
14 | pkg_config("re2_config") {
15 | packages = [ "re2" ]
16 | }
17 |
18 | shim_headers("re2_shim") {
19 | root_path = "src"
20 | headers = [
21 | "re2/filtered_re2.h",
22 | "re2/re2.h",
23 | "re2/set.h",
24 | "re2/stringpiece.h",
25 | "re2/variadic_function.h",
26 | ]
27 | }
28 |
29 | source_set("re2") {
30 | deps = [ ":re2_shim" ]
31 | public_configs = [ ":re2_config" ]
32 | }
33 |
--------------------------------------------------------------------------------
/build/linux/unbundle/snappy.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/shim_headers.gni")
6 |
7 | shim_headers("snappy_shim") {
8 | root_path = "src"
9 | headers = [
10 | "snappy-c.h",
11 | "snappy-sinksource.h",
12 | "snappy-stubs-public.h",
13 | "snappy.h",
14 | ]
15 | }
16 |
17 | source_set("snappy") {
18 | deps = [ ":snappy_shim" ]
19 | libs = [ "snappy" ]
20 | }
21 |
--------------------------------------------------------------------------------
/build/linux/unbundle/swiftshader-SPIRV-Headers.gn:
--------------------------------------------------------------------------------
1 | import("//build/shim_headers.gni")
2 |
3 | shim_headers("SPIRV-Headers_shim") {
4 | root_path = "../../../../third_party/SPIRV-Headers/include"
5 | headers = [
6 | "spirv/unified1/GLSL.std.450.h",
7 | "spirv/unified1/NonSemanticClspvReflection.h",
8 | "spirv/unified1/NonSemanticDebugPrintf.h",
9 | "spirv/unified1/OpenCL.std.h",
10 | "spirv/unified1/spirv.h",
11 | "spirv/unified1/spirv.hpp",
12 | ]
13 | }
14 |
15 | source_set("spv_headers") {
16 | deps = [ ":SPIRV-Headers_shim" ]
17 | }
18 |
--------------------------------------------------------------------------------
/build/linux/unbundle/swiftshader-SPIRV-Tools.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 |
4 | pkg_config("system_SPIRV-Tools") {
5 | packages = [ "SPIRV-Tools" ]
6 | }
7 |
8 | shim_headers("SPIRV-Tools_shim") {
9 | root_path = "../../../../third_party/SPIRV-Tools/include"
10 | headers = [
11 | "spirv-tools/instrument.hpp",
12 | "spirv-tools/libspirv.h",
13 | "spirv-tools/libspirv.hpp",
14 | "spirv-tools/linker.hpp",
15 | "spirv-tools/optimizer.hpp",
16 | ]
17 | }
18 |
19 | source_set("spvtools_headers") {
20 | deps = [ ":SPIRV-Tools_shim" ]
21 | public_configs = [ ":system_SPIRV-Tools" ]
22 | }
23 |
24 | source_set("spvtools_opt") {
25 | deps = [ ":SPIRV-Tools_shim" ]
26 | public_configs = [ ":system_SPIRV-Tools" ]
27 | }
28 |
29 | source_set("spvtools_val") {
30 | deps = [ ":SPIRV-Tools_shim" ]
31 | public_configs = [ ":system_SPIRV-Tools" ]
32 | }
33 |
--------------------------------------------------------------------------------
/build/linux/unbundle/vulkan-SPIRV-Headers.gn:
--------------------------------------------------------------------------------
1 | # This shim can only be used if you build Chromium without DAWN
2 |
3 | import("//build/shim_headers.gni")
4 |
5 | shim_headers("vulkan-SPIRV-Headers_shim") {
6 | root_path = "include"
7 | headers = [
8 | "spirv/unified1/GLSL.std.450.h",
9 | "spirv/unified1/NonSemanticClspvReflection.h",
10 | "spirv/unified1/NonSemanticDebugPrintf.h",
11 | "spirv/unified1/OpenCL.std.h",
12 | "spirv/unified1/spirv.h",
13 | "spirv/unified1/spirv.hpp",
14 | ]
15 | }
16 |
17 | source_set("spv_headers") {
18 | deps = [ ":vulkan-SPIRV-Headers_shim" ]
19 | }
20 |
--------------------------------------------------------------------------------
/build/linux/unbundle/vulkan_memory_allocator.gn:
--------------------------------------------------------------------------------
1 | config("vulkan_memory_allocator_config") {
2 | libs = ["VulkanMemoryAllocator"]
3 | }
4 |
5 | source_set("vulkan_memory_allocator") {
6 | public_configs = [ ":vulkan_memory_allocator_config" ]
7 | }
8 |
--------------------------------------------------------------------------------
/build/linux/unbundle/woff2.gn:
--------------------------------------------------------------------------------
1 | import("//build/config/linux/pkg_config.gni")
2 | import("//build/shim_headers.gni")
3 |
4 | pkg_config("system_woff2") {
5 | packages = [ "libwoff2dec" ]
6 | }
7 |
8 | shim_headers("woff2_shim") {
9 | root_path = "include"
10 | headers = [
11 | "woff2/decode.h",
12 | "woff2/encode.h",
13 | "woff2/output.h",
14 | ]
15 | }
16 |
17 | source_set("woff2_dec") {
18 | deps = [ ":woff2_shim" ]
19 | public_configs = [ ":system_woff2" ]
20 | }
21 |
--------------------------------------------------------------------------------
/build/linux/unbundle/zstd.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2024 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/linux/pkg_config.gni")
6 | import("//build/shim_headers.gni")
7 |
8 | pkg_config("system_zstd") {
9 | packages = [ "libzstd" ]
10 | }
11 |
12 | shim_headers("zstd_headers") {
13 | root_path = "src/lib"
14 | headers = [
15 | "zstd.h",
16 | "zstd_errors.h",
17 | ]
18 | }
19 |
20 | source_set("compress") {
21 | public_configs = [ ":system_zstd" ]
22 | public_deps = [ ":zstd_headers" ]
23 | }
24 | source_set("decompress") {
25 | public_configs = [ ":system_zstd" ]
26 | public_deps = [ ":zstd_headers" ]
27 | }
28 |
--------------------------------------------------------------------------------
/build/mac/OWNERS:
--------------------------------------------------------------------------------
1 | file://build/apple/OWNERS
2 |
--------------------------------------------------------------------------------
/build/metadata.json.in:
--------------------------------------------------------------------------------
1 | {
2 | "content": {
3 | "version": "@MAJOR@.@MINOR@.@BUILD@.@PATCH@"
4 | },
5 | "metadata_version": 1
6 | }
7 |
--------------------------------------------------------------------------------
/build/noop.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 | """Script that does nothing successfully."""
5 |
--------------------------------------------------------------------------------
/build/precompile.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2011 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // Precompiled header generator for Windows builds. No include is needed
6 | // in this file as the PCH include is forced via the "Forced Include File"
7 | // flag in the projects generated by GYP.
8 |
--------------------------------------------------------------------------------
/build/protoc_java.pydeps:
--------------------------------------------------------------------------------
1 | # Generated by running:
2 | # build/print_python_deps.py --root build --output build/protoc_java.pydeps build/protoc_java.py
3 | action_helpers.py
4 | android/gyp/util/__init__.py
5 | android/gyp/util/build_utils.py
6 | gn_helpers.py
7 | protoc_java.py
8 | zip_helpers.py
9 |
--------------------------------------------------------------------------------
/build/redirect_stdout.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 |
6 | import os
7 | import subprocess
8 | import sys
9 |
10 | # This script executes a command and redirects the stdout to a file. This is
11 | # equivalent to |command... > output_file|.
12 | #
13 | # Usage: python redirect_stdout.py output_file command...
14 |
15 | if __name__ == '__main__':
16 | if len(sys.argv) < 2:
17 | print("Usage: %s output_file command..." % sys.argv[0], file=sys.stderr)
18 | sys.exit(1)
19 |
20 | # This script is designed to run binaries produced by the current build. We
21 | # may prefix it with "./" to avoid picking up system versions that might
22 | # also be on the path.
23 | path = sys.argv[2]
24 | if not os.path.isabs(path):
25 | path = './' + path
26 |
27 | with open(sys.argv[1], 'w') as fp:
28 | sys.exit(subprocess.check_call([path] + sys.argv[3:], stdout=fp))
29 |
--------------------------------------------------------------------------------
/build/rust/OWNERS:
--------------------------------------------------------------------------------
1 | adetaylor@chromium.org
2 | ajgo@chromium.org
3 | collinbaker@chromium.org
4 | dcheng@chromium.org
5 | lukasza@chromium.org
6 | thakis@chromium.org
7 |
--------------------------------------------------------------------------------
/build/rust/bindings.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #[allow(dead_code)]
6 | #[allow(non_snake_case)]
7 | #[allow(non_camel_case_types)]
8 | #[allow(non_upper_case_globals)]
9 | mod bindings {
10 | include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
11 | }
12 |
13 | #[cfg(cpp)]
14 | pub use bindings::root::*;
15 | #[cfg(not(cpp))]
16 | pub use bindings::*;
17 |
--------------------------------------------------------------------------------
/build/rust/chromium_prelude/import_test.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | mod test_direct {
6 | chromium::import! {
7 | "//build/rust/chromium_prelude:import_test_lib";
8 | }
9 |
10 | pub fn import_test() {
11 | import_test_lib::import_test_lib();
12 | }
13 | }
14 |
15 | mod test_as {
16 | chromium::import! {
17 | "//build/rust/chromium_prelude:import_test_lib" as library;
18 | }
19 |
20 | pub fn import_test() {
21 | library::import_test_lib();
22 | }
23 | }
24 |
25 | mod test_pub {
26 | chromium::import! {
27 | pub "//build/rust/chromium_prelude:import_test_lib" as library;
28 | }
29 | }
30 |
31 | fn main() {
32 | test_direct::import_test();
33 | test_as::import_test();
34 | test_pub::library::import_test_lib();
35 | }
36 |
--------------------------------------------------------------------------------
/build/rust/chromium_prelude/import_test_lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | pub fn import_test_lib() {}
6 |
--------------------------------------------------------------------------------
/build/rust/cxx_version.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2024 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | # The version of cxx under //third_party/rust/chromium_crates_io/vendor.
6 | # Update this whenever cxx is rolled.
7 | cxx_version = "1.0.135"
8 |
--------------------------------------------------------------------------------
/build/rust/filter_clang_args.py:
--------------------------------------------------------------------------------
1 | # Copyright 2022 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 | """
5 | Filters clang args to make them suitable for libclang.
6 |
7 | Rust involves several libclang-based tools that parse C++.
8 | We pass such tools our complete {{cflags}}, but a few of the
9 | arguments aren't appropriate for libclang (for example those
10 | which load plugins).
11 |
12 | This function filters them out.
13 | """
14 |
15 |
16 | def filter_clang_args(clangargs):
17 | def do_filter(args):
18 | i = 0
19 | while i < len(args):
20 | # Intercept plugin arguments
21 | if args[i] == '-Xclang':
22 | i += 1
23 | if args[i] == '-add-plugin':
24 | pass
25 | elif args[i].startswith('-plugin-arg'):
26 | i += 2
27 | else:
28 | yield args[i]
29 | i += 1
30 |
31 | return list(do_filter(clangargs))
32 |
--------------------------------------------------------------------------------
/build/rust/rust_macro.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2022 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/config/rust.gni")
6 | import("//build/rust/rust_target.gni")
7 |
8 | # Template for generating a Rust proc-macro library. Such targets produce a
9 | # dynamic library that is loaded during compilation and used to generate Rust
10 | # code for compilation.
11 | template("rust_macro") {
12 | rust_target(target_name) {
13 | forward_variables_from(invoker,
14 | "*",
15 | TESTONLY_AND_VISIBILITY + [ "configs" ])
16 | forward_variables_from(invoker, TESTONLY_AND_VISIBILITY)
17 | proc_macro_configs = invoker.configs
18 | target_type = "rust_proc_macro"
19 | }
20 | }
21 |
22 | set_defaults("rust_macro") {
23 | configs = default_rust_proc_macro_configs
24 | }
25 |
--------------------------------------------------------------------------------
/build/rust/std/DEPS:
--------------------------------------------------------------------------------
1 | include_rules = [
2 | "-base",
3 | ]
4 |
5 | specific_include_rules = {
6 | "remap_alloc.cc" : [
7 | "+partition_alloc"
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/build/rust/std/alias.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // This file has been copied from //base/debug/alias.cc ( additionally the APIs
6 | // were moved into the `build_rust_std` namespace).
7 | //
8 | // TODO(crbug.com/40279749): Avoid code duplication / reuse code.
9 |
10 | #include "build/rust/std/alias.h"
11 |
12 | #include "build/rust/std/compiler_specific.h"
13 |
14 | namespace build_rust_std {
15 | namespace debug {
16 |
17 | // This file/function should be excluded from LTO/LTCG to ensure that the
18 | // compiler can't see this function's implementation when compiling calls to it.
19 | NOINLINE void Alias(const void* var) {}
20 |
21 | } // namespace debug
22 | } // namespace build_rust_std
23 |
--------------------------------------------------------------------------------
/build/rust/std/fake_root/.cargo/config.toml.template:
--------------------------------------------------------------------------------
1 | [source.crates-io]
2 | replace-with = 'vendored-sources'
3 |
4 | [source.vendored-sources]
5 | directory = '../../../../RUST_SRC_ROOT/library/vendor'
6 |
--------------------------------------------------------------------------------
/build/rust/std/fake_root/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | /Cargo.lock
3 | /Cargo.toml
4 | /.cargo/config.toml
5 |
--------------------------------------------------------------------------------
/build/rust/std/fake_root/Cargo.toml.template:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "fake_root"
3 | version = "0.1.0"
4 | edition = "2021"
5 |
6 | [dependencies]
7 |
8 | [dependencies.sysroot]
9 | path = "../../../../RUST_SRC_ROOT/library/sysroot"
10 | default-features = false
11 | features = [
12 | "backtrace",
13 | "panic-unwind",
14 | "profiler",
15 | "std_detect_dlsym_getauxval",
16 | "std_detect_file_io"
17 | ]
18 |
19 | [patch.crates-io]
20 | rustc-std-workspace-core = { path = '../../../../RUST_SRC_ROOT/library/rustc-std-workspace-core' }
21 | rustc-std-workspace-alloc = { path = '../../../../RUST_SRC_ROOT/library/rustc-std-workspace-alloc' }
22 | rustc-std-workspace-std = { path = '../../../../RUST_SRC_ROOT/library/rustc-std-workspace-std' }
23 |
--------------------------------------------------------------------------------
/build/rust/std/fake_root/README.md:
--------------------------------------------------------------------------------
1 | This package is used to discover the libstd deps using `cargo metadata`. gnrt
2 | uses it when generating libstd GN bindings.
3 |
--------------------------------------------------------------------------------
/build/rust/std/fake_root/src/main.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
--------------------------------------------------------------------------------
/build/rust/tests/bindgen_cpp_test/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2024 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/rust/rust_bindgen.gni")
6 | import("//build/rust/rust_executable.gni")
7 |
8 | source_set("cpp_lib") {
9 | sources = [
10 | "cpp.cc",
11 | "cpp.h",
12 | ]
13 | }
14 |
15 | rust_bindgen("cpp_lib_bindgen") {
16 | deps = [ ":cpp_lib" ]
17 | header = "cpp.h"
18 | cpp = true
19 | }
20 |
21 | rust_executable("bindgen_cpp_test") {
22 | deps = [
23 | ":cpp_lib",
24 | ":cpp_lib_bindgen",
25 | ]
26 | sources = [ "main.rs" ]
27 | crate_root = "main.rs"
28 |
29 | allow_unsafe = true # Needed for FFI.
30 | }
31 |
--------------------------------------------------------------------------------
/build/rust/tests/bindgen_cpp_test/cpp.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "build/rust/tests/bindgen_cpp_test/cpp.h"
6 |
7 | namespace functions {
8 |
9 | int normal_fn(int i) {
10 | return template_fn(i);
11 | }
12 |
13 | } // namespace functions
14 |
--------------------------------------------------------------------------------
/build/rust/tests/bindgen_cpp_test/cpp.h:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BUILD_RUST_TESTS_BINDGEN_CPP_TEST_CPP_H_
6 | #define BUILD_RUST_TESTS_BINDGEN_CPP_TEST_CPP_H_
7 |
8 | // We use some C++20 stuff to ensure the correct mode is being used.
9 | template
10 | concept AlwaysTrue = true;
11 |
12 | namespace functions {
13 |
14 | inline constexpr int kNumber = 2;
15 |
16 | int template_fn(AlwaysTrue auto i) {
17 | return i;
18 | }
19 |
20 | int normal_fn(int i);
21 |
22 | } // namespace functions
23 |
24 | #endif // BUILD_RUST_TESTS_BINDGEN_CPP_TEST_CPP_H_
25 |
--------------------------------------------------------------------------------
/build/rust/tests/bindgen_cpp_test/main.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | chromium::import! {
6 | "//build/rust/tests/bindgen_cpp_test:cpp_lib_bindgen";
7 | }
8 |
9 | pub fn main() {
10 | let from_cpp =
11 | unsafe { cpp_lib_bindgen::functions::normal_fn(cpp_lib_bindgen::functions::kNumber) };
12 | println!("2 == {from_cpp}");
13 | assert_eq!(2, from_cpp);
14 | }
15 |
--------------------------------------------------------------------------------
/build/rust/tests/bindgen_cpp_test_with_cpp_linkage/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2024 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/rust/rust_bindgen.gni")
6 | import("//build/rust/rust_static_library.gni")
7 |
8 | source_set("cpp_lib") {
9 | sources = [
10 | "cpp.cc",
11 | "cpp.h",
12 | ]
13 | }
14 |
15 | rust_bindgen("cpp_lib_bindgen") {
16 | deps = [ ":cpp_lib" ]
17 | header = "cpp.h"
18 | cpp = true
19 | }
20 |
21 | rust_static_library("rust_lib") {
22 | deps = [
23 | ":cpp_lib",
24 | ":cpp_lib_bindgen",
25 | ]
26 | sources = [ "lib.rs" ]
27 | crate_root = "lib.rs"
28 |
29 | allow_unsafe = true # Needed for FFI.
30 | }
31 |
32 | executable("bindgen_cpp_test_with_cpp_linkage") {
33 | sources = [ "main.cc" ]
34 | deps = [ ":rust_lib" ]
35 | }
36 |
--------------------------------------------------------------------------------
/build/rust/tests/bindgen_cpp_test_with_cpp_linkage/cpp.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "build/rust/tests/bindgen_cpp_test_with_cpp_linkage/cpp.h"
6 |
7 | namespace functions {
8 |
9 | int normal_fn(int i) {
10 | return template_fn(i);
11 | }
12 |
13 | } // namespace functions
14 |
--------------------------------------------------------------------------------
/build/rust/tests/bindgen_cpp_test_with_cpp_linkage/cpp.h:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BUILD_RUST_TESTS_BINDGEN_CPP_TEST_WITH_CPP_LINKAGE_CPP_H_
6 | #define BUILD_RUST_TESTS_BINDGEN_CPP_TEST_WITH_CPP_LINKAGE_CPP_H_
7 |
8 | // We use some C++20 stuff to ensure the correct mode is being used.
9 | template
10 | concept AlwaysTrue = true;
11 |
12 | namespace functions {
13 |
14 | inline constexpr int kNumber = 2;
15 |
16 | int template_fn(AlwaysTrue auto i) {
17 | return i;
18 | }
19 |
20 | int normal_fn(int i);
21 |
22 | } // namespace functions
23 |
24 | #endif // BUILD_RUST_TESTS_BINDGEN_CPP_TEST_WITH_CPP_LINKAGE_CPP_H_
25 |
--------------------------------------------------------------------------------
/build/rust/tests/bindgen_cpp_test_with_cpp_linkage/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | chromium::import! {
6 | "//build/rust/tests/bindgen_cpp_test_with_cpp_linkage:cpp_lib_bindgen";
7 | }
8 |
9 | #[no_mangle]
10 | pub fn rust_main() {
11 | let from_cpp =
12 | unsafe { cpp_lib_bindgen::functions::normal_fn(cpp_lib_bindgen::functions::kNumber) };
13 | println!("2 == {from_cpp}");
14 | assert_eq!(2, from_cpp);
15 | }
16 |
--------------------------------------------------------------------------------
/build/rust/tests/bindgen_cpp_test_with_cpp_linkage/main.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | extern "C" void rust_main();
6 |
7 | int main() {
8 | rust_main();
9 | }
10 |
--------------------------------------------------------------------------------
/build/rust/tests/bindgen_static_fns_test/lib.c:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "build/rust/tests/bindgen_static_fns_test/lib.h"
6 |
7 | #include
8 |
9 | COMPONENT_EXPORT uint32_t mul_two_numbers(uint32_t a, uint32_t b) {
10 | return a * b;
11 | }
12 |
--------------------------------------------------------------------------------
/build/rust/tests/bindgen_static_fns_test/main.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | chromium::import! {
6 | "//build/rust/tests/bindgen_static_fns_test:bindgen_static_fns_test_lib";
7 | }
8 |
9 | use bindgen_static_fns_test_lib::mul_three_numbers_in_c;
10 |
11 | fn main() {
12 | println!("{} * {} * {} = {}", 3, 7, 11, mul_three_numbers_in_c(3, 7, 11));
13 | }
14 |
--------------------------------------------------------------------------------
/build/rust/tests/bindgen_static_fns_test/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | chromium::import! {
6 | "//build/rust/tests/bindgen_static_fns_test:c_lib_bindgen";
7 | }
8 |
9 | pub fn mul_three_numbers_in_c(a: u32, b: u32, c: u32) -> u32 {
10 | unsafe { c_lib_bindgen::mul_three_numbers(a, b, c) }
11 | }
12 |
13 | #[cfg(test)]
14 | mod tests {
15 | use super::*;
16 |
17 | #[test]
18 | fn test_mul_three_numbers() {
19 | assert_eq!(mul_three_numbers_in_c(5, 10, 15), 750);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/build/rust/tests/bindgen_test/lib.c:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "build/rust/tests/bindgen_test/lib.h"
6 |
7 | #include
8 |
9 | COMPONENT_EXPORT uint32_t add_two_numbers(uint32_t a, uint32_t b) {
10 | return a + b;
11 | }
12 |
--------------------------------------------------------------------------------
/build/rust/tests/bindgen_test/lib2.h:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BUILD_RUST_TESTS_BINDGEN_TEST_LIB2_H_
6 | #define BUILD_RUST_TESTS_BINDGEN_TEST_LIB2_H_
7 |
8 | // This file does nothing, it just tests the include paths when running bindgen.
9 |
10 | #endif // BUILD_RUST_TESTS_BINDGEN_TEST_LIB2_H_
11 |
--------------------------------------------------------------------------------
/build/rust/tests/bindgen_test/main.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | chromium::import! {
6 | "//build/rust/tests/bindgen_test:bindgen_test_lib";
7 | }
8 |
9 | use bindgen_test_lib::add_two_numbers_in_c;
10 |
11 | fn main() {
12 | println!("{} + {} = {}", 3, 7, add_two_numbers_in_c(3, 7));
13 | }
14 |
--------------------------------------------------------------------------------
/build/rust/tests/bindgen_test/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | chromium::import! {
6 | "//build/rust/tests/bindgen_test:c_lib_bindgen";
7 | }
8 |
9 | pub fn add_two_numbers_in_c(a: u32, b: u32) -> u32 {
10 | unsafe { c_lib_bindgen::add_two_numbers(a, b) }
11 | }
12 |
13 | #[cfg(test)]
14 | mod tests {
15 | use super::*;
16 |
17 | #[test]
18 | fn test_add_two_numbers() {
19 | assert_eq!(add_two_numbers_in_c(5, 10), 15);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/build/rust/tests/test_aliased_deps/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | pub use other_name;
6 |
7 | #[cfg(test)]
8 | #[test]
9 | fn test_add_from_renamed_dep() {
10 | assert_eq!(other_name::add(2, 3), 5);
11 | }
12 |
--------------------------------------------------------------------------------
/build/rust/tests/test_aliased_deps/main.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | chromium::import! {
6 | "//build/rust/tests/test_aliased_deps";
7 | }
8 |
9 | fn main() {
10 | test_aliased_deps::other_name::hello_world();
11 | }
12 |
--------------------------------------------------------------------------------
/build/rust/tests/test_aliased_deps/real_name.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | pub fn hello_world() {
6 | println!("hello world");
7 | }
8 |
9 | pub fn add(a: u32, b: u32) -> u32 {
10 | a + b
11 | }
12 |
--------------------------------------------------------------------------------
/build/rust/tests/test_bin_crate/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2021 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/rust/cargo_crate.gni")
6 |
7 | cargo_crate("test_bin_crate") {
8 | crate_type = "bin"
9 | crate_root = "crate/src/main.rs"
10 | sources = [
11 | "crate/src/main.rs",
12 | "crate/src/more.rs",
13 | ]
14 | build_sources = [ "crate/build.rs" ]
15 | build_root = "crate/build.rs"
16 |
17 | rustenv = [ "BUILD_SCRIPT_TEST_VARIABLE=123" ]
18 | }
19 |
--------------------------------------------------------------------------------
/build/rust/tests/test_bin_crate/crate/src/main.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | mod more;
6 |
7 | fn main() {
8 | println!("Hello, world!");
9 | #[cfg(is_new_rustc)]
10 | println!("Is new rustc!");
11 | #[cfg(is_old_rustc)]
12 | println!("Is old rustc!");
13 | #[cfg(is_android)]
14 | println!("Is android!");
15 | #[cfg(is_mac)]
16 | println!("Is darwin!");
17 |
18 | more::hello();
19 | }
20 |
--------------------------------------------------------------------------------
/build/rust/tests/test_bin_crate/crate/src/more.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | pub fn hello() {}
6 |
--------------------------------------------------------------------------------
/build/rust/tests/test_control_flow_guard/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/rust/rust_executable.gni")
6 |
7 | rust_executable("test_control_flow_guard") {
8 | allow_unsafe = true
9 | crate_root = "test_control_flow_guard.rs"
10 | sources = [ crate_root ]
11 | }
12 |
--------------------------------------------------------------------------------
/build/rust/tests/test_cpp_including_rust/main.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "build/rust/tests/test_rust_static_library/src/lib.rs.h"
6 |
7 | int main(int argc, char* argv[]) {
8 | say_hello();
9 | add_two_ints_via_rust(3, 4);
10 | return 0;
11 | }
12 |
--------------------------------------------------------------------------------
/build/rust/tests/test_proc_macro_crate/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2021 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/rust/cargo_crate.gni")
6 |
7 | cargo_crate("test_proc_macro_crate") {
8 | crate_root = "crate/src/lib.rs"
9 | crate_type = "proc-macro"
10 | sources = [ "crate/src/lib.rs" ]
11 | epoch = "0.2"
12 | }
13 |
--------------------------------------------------------------------------------
/build/rust/tests/test_proc_macro_crate/crate/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | use proc_macro::TokenStream;
6 |
7 | #[proc_macro]
8 | pub fn calculate_using_proc_macro(_item: TokenStream) -> TokenStream {
9 | "(15 + 15)".parse().unwrap()
10 | }
11 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rlib_crate/crate/src/main.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | pub fn main() {
6 | test_rlib_crate::say_hello_from_crate();
7 | }
8 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rlib_crate_testonly/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/rust/cargo_crate.gni")
6 |
7 | cargo_crate("testonly_target") {
8 | testonly = true
9 | crate_root = "crate/src/main.rs"
10 | crate_type = "bin"
11 | sources = [ "crate/src/main.rs" ]
12 | build_sources = [ "crate/build.rs" ]
13 | build_root = "crate/build.rs"
14 | build_deps = [ ":testonly_build_dep" ]
15 | }
16 |
17 | cargo_crate("testonly_build_dep") {
18 | testonly = true
19 | crate_name = "test_only_build_dep"
20 | crate_root = "crate/src/lib.rs"
21 | sources = [ "crate/src/lib.rs" ]
22 | }
23 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rlib_crate_testonly/crate/build.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | fn main() {}
6 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rlib_crate_testonly/crate/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rlib_crate_testonly/crate/src/main.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | pub fn main() {}
6 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rs_bindings_from_cc/self_contained_target_header1.h:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BUILD_RUST_TESTS_TEST_RS_BINDINGS_FROM_CC_SELF_CONTAINED_TARGET_HEADER1_H_
6 | #define BUILD_RUST_TESTS_TEST_RS_BINDINGS_FROM_CC_SELF_CONTAINED_TARGET_HEADER1_H_
7 |
8 | inline int MultiplyViaCc(int x, int y) {
9 | return x * y;
10 | }
11 |
12 | #endif // BUILD_RUST_TESTS_TEST_RS_BINDINGS_FROM_CC_SELF_CONTAINED_TARGET_HEADER1_H_
13 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rs_bindings_from_cc/self_contained_target_header2.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "build/rust/tests/test_rs_bindings_from_cc/self_contained_target_header2.h"
6 |
7 | int AddViaCc(int x, int y) {
8 | return x + y;
9 | }
10 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rs_bindings_from_cc/self_contained_target_header2.h:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BUILD_RUST_TESTS_TEST_RS_BINDINGS_FROM_CC_SELF_CONTAINED_TARGET_HEADER2_H_
6 | #define BUILD_RUST_TESTS_TEST_RS_BINDINGS_FROM_CC_SELF_CONTAINED_TARGET_HEADER2_H_
7 |
8 | int AddViaCc(int x, int y);
9 |
10 | struct CcPodStruct final {
11 | int value;
12 | };
13 |
14 | #endif // BUILD_RUST_TESTS_TEST_RS_BINDINGS_FROM_CC_SELF_CONTAINED_TARGET_HEADER2_H_
15 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rs_bindings_from_cc/target_depending_on_another.h:
--------------------------------------------------------------------------------
1 | // Copyright 2022 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BUILD_RUST_TESTS_TEST_RS_BINDINGS_FROM_CC_TARGET_DEPENDING_ON_ANOTHER_H_
6 | #define BUILD_RUST_TESTS_TEST_RS_BINDINGS_FROM_CC_TARGET_DEPENDING_ON_ANOTHER_H_
7 |
8 | #include "build/rust/tests/test_rs_bindings_from_cc/self_contained_target_header2.h"
9 |
10 | inline CcPodStruct CreateCcPodStructFromValue(int x) {
11 | return CcPodStruct{.value = x};
12 | }
13 |
14 | #endif // BUILD_RUST_TESTS_TEST_RS_BINDINGS_FROM_CC_TARGET_DEPENDING_ON_ANOTHER_H_
15 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_calling_cpp/BUILD.gn:
--------------------------------------------------------------------------------
1 | import("//build/rust/rust_static_library.gni")
2 |
3 | static_library("cpp_library") {
4 | sources = [
5 | "cpp_library.cc",
6 | "cpp_library.h",
7 | ]
8 | }
9 |
10 | rust_static_library("rust_calling_cpp_rlib") {
11 | sources = [ "rust_calling_cpp_rlib.rs" ]
12 | crate_root = "rust_calling_cpp_rlib.rs"
13 | cxx_bindings = [ "rust_calling_cpp_rlib.rs" ]
14 | allow_unsafe = true
15 | deps = [ ":cpp_library" ]
16 | }
17 |
18 | executable("test_rust_calling_cpp") {
19 | deps = [ ":rust_calling_cpp_rlib" ]
20 | sources = [ "main.cc" ]
21 | }
22 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_calling_cpp/cpp_library.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "build/rust/tests/test_rust_calling_cpp/cpp_library.h"
6 |
7 | #include
8 |
9 | int32_t mul_by_2_in_cpp_library(int32_t a) {
10 | return a * 2;
11 | }
12 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_calling_cpp/cpp_library.h:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef BUILD_RUST_TESTS_TEST_RUST_CALLING_CPP_CPP_LIBRARY_H_
6 | #define BUILD_RUST_TESTS_TEST_RUST_CALLING_CPP_CPP_LIBRARY_H_
7 |
8 | #include
9 |
10 | int32_t mul_by_2_in_cpp_library(int32_t a);
11 |
12 | #endif // BUILD_RUST_TESTS_TEST_RUST_CALLING_CPP_CPP_LIBRARY_H_
13 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_calling_cpp/main.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "build/rust/tests/test_rust_calling_cpp/rust_calling_cpp_rlib.rs.h"
6 |
7 | int main() {
8 | rust_calling_cpp();
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_calling_cpp/rust_calling_cpp_rlib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #[cxx::bridge]
6 | mod ffi {
7 | extern "Rust" {
8 | fn rust_calling_cpp();
9 | }
10 |
11 | unsafe extern "C++" {
12 | include!("build/rust/tests/test_rust_calling_cpp/cpp_library.h");
13 |
14 | fn mul_by_2_in_cpp_library(a: i32) -> i32;
15 | }
16 | }
17 |
18 | #[no_mangle]
19 | pub fn rust_calling_cpp() {
20 | assert_eq!(ffi::mul_by_2_in_cpp_library(3), 6);
21 | }
22 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_exe/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2021 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/rust/rust_executable.gni")
6 |
7 | rust_executable("test_rust_exe") {
8 | crate_root = "main.rs"
9 | sources = [ "main.rs" ]
10 | deps = [
11 | "//build/rust/tests/test_proc_macro_crate",
12 | "//build/rust/tests/test_rlib_crate:target1",
13 | "//build/rust/tests/test_rust_static_library",
14 | "//build/rust/tests/test_rust_static_library_non_standard_arrangement:lib",
15 | ]
16 | build_native_rust_unit_tests = true
17 | }
18 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_metadata/foo_dependency.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // Reexporting the function should also work fine.
6 | pub use transitive_dep::say_something as say_foo_directly;
7 |
8 | pub fn say_foo() -> String {
9 | transitive_dep::say_something()
10 | }
11 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_metadata/main.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | extern "C" void print_foo_bar();
6 |
7 | int main() {
8 | print_foo_bar();
9 | }
10 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_metadata/main.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | chromium::import! {
6 | "//build/rust/tests/test_rust_metadata:lib";
7 | }
8 |
9 | fn main() {
10 | lib::print_foo_bar();
11 | println!("{} from re-exported function", lib::say_foo_directly());
12 | }
13 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_metadata/tests.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | chromium::import! {
6 | "//build/rust/tests/test_rust_metadata:lib";
7 | }
8 |
9 | #[test]
10 | fn test_expected_outputs() {
11 | assert_eq!(lib::say_foo(), "foo");
12 | assert_eq!(lib::say_foo_directly(), "foo");
13 | assert_eq!(lib::say_something(), "bar");
14 | }
15 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_metadata/transitive_dep.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2023 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | pub fn say_something() -> String {
6 | #[cfg(feature = "bar_feature")]
7 | {
8 | "bar".to_string()
9 | }
10 | #[cfg(not(feature = "bar_feature"))]
11 | {
12 | "foo".to_string()
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_multiple_dep_versions_exe/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2021 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/rust/rust_executable.gni")
6 | import("//build/rust/rust_static_library.gni")
7 |
8 | # The exe depends on lib v1. But it also transitively depends on lib v2.
9 | # The code in the exe should use v1, and the code in the transitive lib should
10 | # use v2.
11 | rust_executable("test_rust_multiple_dep_versions_exe") {
12 | crate_root = "main.rs"
13 | sources = [ "main.rs" ]
14 | deps = [
15 | ":transitive_v2",
16 | "//build/rust/tests/test_rust_multiple_dep_versions_exe/v1:test_lib",
17 | ]
18 | }
19 |
20 | rust_static_library("transitive_v2") {
21 | crate_root = "transitive_lib.rs"
22 | sources = [ "transitive_lib.rs" ]
23 | deps =
24 | [ "//build/rust/tests/test_rust_multiple_dep_versions_exe/v2:test_lib" ]
25 | }
26 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_multiple_dep_versions_exe/main.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | chromium::import! {
6 | "//build/rust/tests/test_rust_multiple_dep_versions_exe:transitive_v2";
7 | }
8 |
9 | // To mimic third-party, the `test_lib` crate has a short name which does not
10 | // need to be import!ed.
11 |
12 | fn main() {
13 | test_lib::say_hello_from_v1();
14 | transitive_v2::transitively_say_hello();
15 | }
16 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_multiple_dep_versions_exe/transitive_lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // To mimic third-party, the `test_lib` crate has a short name which does not
6 | // need to be import!ed.
7 |
8 | pub fn transitively_say_hello() {
9 | test_lib::say_hello_from_v2();
10 | }
11 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_multiple_dep_versions_exe/v1/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2021 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/rust/cargo_crate.gni")
6 |
7 | cargo_crate("test_lib") {
8 | crate_name = "test_lib"
9 |
10 | # This crate has the same name as v2/test_lib, but a different epoch. The GN
11 | # target for the unit tests should not collide.
12 | epoch = "1"
13 | sources = [ "src/lib.rs" ]
14 | }
15 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_multiple_dep_versions_exe/v1/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | pub fn say_hello_from_v1() {
6 | println!("Hello, world - from lib version 1");
7 | }
8 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_multiple_dep_versions_exe/v2/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2021 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/rust/cargo_crate.gni")
6 |
7 | cargo_crate("test_lib") {
8 | crate_name = "test_lib"
9 |
10 | # This crate has the same name as v1/test_lib, but a different epoch. The GN
11 | # target for the unit tests should not collide.
12 | epoch = "2"
13 | sources = [ "src/lib.rs" ]
14 | }
15 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_multiple_dep_versions_exe/v2/src/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | pub fn say_hello_from_v2() {
6 | println!("Hello, world - from lib version 2");
7 | }
8 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_shared_library/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2022 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/rust/rust_shared_library.gni")
6 |
7 | rust_shared_library("test_rust_shared_library") {
8 | allow_unsafe = true
9 | sources = [ "src/lib.rs" ]
10 | cxx_bindings = [ "src/lib.rs" ]
11 | build_native_rust_unit_tests = true
12 | }
13 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_static_library/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2021 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/rust/rust_static_library.gni")
6 |
7 | rust_static_library("test_rust_static_library") {
8 | allow_unsafe = true
9 | sources = [ "src/lib.rs" ]
10 | cxx_bindings = [ "src/lib.rs" ]
11 | build_native_rust_unit_tests = true
12 | }
13 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_static_library_non_standard_arrangement/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2021 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/rust/rust_static_library.gni")
6 |
7 | rust_static_library("lib") {
8 | sources = [ "foo.rs" ]
9 | crate_root = "foo.rs"
10 | unit_test_target = "foo_tests"
11 |
12 | # TODO(danakj): We should write a gtest binary instead of using native rust
13 | # tests outside of a cargo_crate().
14 | build_native_rust_unit_tests = true
15 | }
16 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_static_library_non_standard_arrangement/foo.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | pub extern "C" fn do_subtract(a: u32, b: u32) -> u32 {
6 | a - b
7 | }
8 |
9 | #[test]
10 | fn test_ok() {
11 | assert_eq!(do_subtract(12, 8), 4)
12 | }
13 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_unittests/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2021 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/rust/rust_unit_test.gni")
6 |
7 | rust_unit_test("test_rust_unittests") {
8 | sources = [ "main.rs" ]
9 | crate_root = "main.rs"
10 | deps = [ "//build/rust/tests/test_rust_static_library" ]
11 | }
12 |
--------------------------------------------------------------------------------
/build/rust/tests/test_rust_unittests/main.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | chromium::import! {
6 | "//build/rust/tests/test_rust_static_library";
7 | }
8 |
9 | use test_rust_static_library::add_two_ints_via_rust;
10 |
11 | #[test]
12 | fn test_call_into_mixed_static_library() {
13 | assert_eq!(add_two_ints_via_rust(5, 7), 12)
14 | }
15 |
--------------------------------------------------------------------------------
/build/rust/tests/test_serde_json_lenient/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2021 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/rust/rust_static_library.gni")
6 | import("//testing/test.gni")
7 |
8 | rust_static_library("test_serde_json_lenient_rs") {
9 | crate_root = "lib.rs"
10 | allow_unsafe = true
11 | sources = [ "lib.rs" ]
12 | cxx_bindings = [ "lib.rs" ]
13 | deps = [ "//third_party/rust/serde_json_lenient/v0_2:lib" ]
14 | }
15 |
16 | # TODO(crbug.com/40809974) - convert to a pure-
17 | # Rust unit test when that's supported on all platforms.
18 | test("test_serde_json_lenient") {
19 | sources = [ "unittests.cc" ]
20 | deps = [
21 | ":test_serde_json_lenient_rs",
22 | "//base",
23 | "//base/test:run_all_unittests",
24 | "//testing/gmock",
25 | "//testing/gtest",
26 | ]
27 | }
28 |
--------------------------------------------------------------------------------
/build/rust/tests/test_serde_json_lenient/lib.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // Demo library to ensure that serde_json_lenient is working independently of
6 | // its integration with Chromium.
7 |
8 | use serde_json_lenient::{Result, Value};
9 |
10 | #[cxx::bridge]
11 | mod ffi {
12 | extern "Rust" {
13 | fn serde_works() -> bool;
14 | }
15 | }
16 |
17 | fn serde_works() -> bool {
18 | parses_ok().unwrap_or_default()
19 | }
20 |
21 | fn parses_ok() -> Result {
22 | let data = r#"
23 | {
24 | "name": "Slartibartfast",
25 | "planets": [ "Magrathea" ]
26 | }"#;
27 | let v: Value = serde_json_lenient::from_str(data)?;
28 | Ok(v["name"] == "Slartibartfast" && v["planets"][0] == "Magrathea")
29 | }
30 |
--------------------------------------------------------------------------------
/build/rust/tests/test_serde_json_lenient/unittests.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #include "build/rust/tests/test_serde_json_lenient/lib.rs.h"
6 | #include "testing/gtest/include/gtest/gtest.h"
7 |
8 | TEST(RustTest, SerdeJsonTest) {
9 | EXPECT_EQ(true, serde_works());
10 | }
11 |
--------------------------------------------------------------------------------
/build/rust/tests/test_simple_rust_exe/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2021 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | # This should be the simplest possible exe with no dependencies,
6 | # to make it easy to investigate build problems.
7 | # For this reason it uses 'executable' directly rather than
8 | # //build/rust/rust_executable.gni.
9 | executable("test_simple_rust_exe") {
10 | crate_root = "main.rs"
11 | sources = [ crate_root ]
12 | deps = [ "//build/rust/std" ]
13 | }
14 |
--------------------------------------------------------------------------------
/build/rust/tests/test_simple_rust_exe/main.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | fn main() {
6 | println!("Hello, world!");
7 | }
8 |
--------------------------------------------------------------------------------
/build/rust/tests/windows_sys_test/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2022 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/rust/rust_bindgen.gni")
6 | import("//build/rust/rust_executable.gni")
7 | import("//build/rust/rust_static_library.gni")
8 |
9 | rust_executable("windows_sys_test") {
10 | allow_unsafe = true # Calls FFI.
11 | deps = [ "//third_party/rust/windows_sys/v0_52:lib" ]
12 | sources = [ "main.rs" ]
13 | crate_root = "main.rs"
14 | }
15 |
--------------------------------------------------------------------------------
/build/rust/tests/windows_sys_test/main.rs:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | use std::ffi::CString;
6 | use windows_sys::Win32::Storage::FileSystem::{OpenFile, OFSTRUCT};
7 |
8 | fn main() {
9 | let filename = CString::new("hi").unwrap();
10 | let mut out = OFSTRUCT {
11 | cBytes: 0,
12 | fFixedDisk: 0,
13 | nErrCode: 0,
14 | Reserved1: 0,
15 | Reserved2: 0,
16 | szPathName: [0; 128],
17 | };
18 | let ustyle: u32 = 0;
19 | unsafe { OpenFile(filename.as_bytes().as_ptr(), &mut out as *mut OFSTRUCT, ustyle) };
20 | }
21 |
--------------------------------------------------------------------------------
/build/sample_arg_file.gn:
--------------------------------------------------------------------------------
1 | # Build arguments go here. Here are some of the most commonly set ones.
2 | # Run `gn args --list` for the full list.
3 | # is_component_build = true
4 | # is_debug = true
5 | # symbol_level = 2
6 | # use_remoteexec = false
7 |
--------------------------------------------------------------------------------
/build/sanitize-mac-build-log.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Copyright 2010 The Chromium Authors
3 | # Use of this source code is governed by a BSD-style license that can be
4 | # found in the LICENSE file.
5 | sed -r -f `dirname "${0}"`/`basename "${0}" sh`sed
6 |
--------------------------------------------------------------------------------
/build/sanitize-win-build-log.sed:
--------------------------------------------------------------------------------
1 | # Copyright 2012 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | # Use this sed script to reduce a Windows build log into something
6 | # machine-parsable.
7 |
8 | # Drop uninformative lines.
9 | /The operation completed successfully\./d
10 |
11 | # Drop parallelization indicators on lines.
12 | s/^[0-9]+>//
13 |
14 | # Shorten bindings generation lines
15 | s/^.*"python".*idl_compiler\.py".*("[^"]+\.idl").*$/ idl_compiler \1/
16 |
--------------------------------------------------------------------------------
/build/sanitize-win-build-log.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Copyright 2010 The Chromium Authors
3 | # Use of this source code is governed by a BSD-style license that can be
4 | # found in the LICENSE file.
5 | sed -r -f `dirname "${0}"`/`basename "${0}" sh`sed
6 |
--------------------------------------------------------------------------------
/build/sanitizers/OWNERS:
--------------------------------------------------------------------------------
1 | eugenis@chromium.org
2 | glider@chromium.org
3 | rnk@chromium.org
4 | per-file tsan_suppressions.cc=*
5 | per-file lsan_suppressions.cc=*
6 |
--------------------------------------------------------------------------------
/build/sanitizers/asan_suppressions.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2015 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // This file contains the default suppressions for AddressSanitizer.
6 | // It should only be used under very limited circumstances such as suppressing
7 | // a report caused by an interceptor call in a system-installed library.
8 |
9 | #if defined(ADDRESS_SANITIZER)
10 |
11 | // Please make sure the code below declares a single string variable
12 | // kASanDefaultSuppressions which contains ASan suppressions delimited by
13 | // newlines. Entries should look, for example, like:
14 | //
15 | // // http://crbug.com/178677
16 | // "interceptor_via_lib:libsqlite3.so\n"
17 | char kASanDefaultSuppressions[] =
18 | // End of suppressions.
19 | // PLEASE READ ABOVE BEFORE ADDING NEW SUPPRESSIONS.
20 | ""; // Please keep this semicolon.
21 |
22 | #endif // ADDRESS_SANITIZER
23 |
--------------------------------------------------------------------------------
/build/sanitizers/dlcloseshim.c:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // In due course we may need to replicate more of the complexity from
6 | // base/allocator/partition_allocator/src/partition_alloc/
7 | // shim/allocator_shim_internals.h
8 | // but as we're targeting just libfuzzer Linux builds, perhaps we don't need
9 | // it.
10 |
11 | #if defined(__clang__)
12 | __attribute__((visibility("default"), noinline))
13 | #endif
14 | void __wrap_dlclose(void *handle) {
15 | // Do nothing. We don't want to call the real dlclose on libfuzzer builds.
16 | }
17 |
--------------------------------------------------------------------------------
/build/skia_gold_common/.style.yapf:
--------------------------------------------------------------------------------
1 | [style]
2 | based_on_style = pep8
3 |
4 | column_limit = 80
5 | indent_width = 2
6 |
7 |
--------------------------------------------------------------------------------
/build/skia_gold_common/OWNERS:
--------------------------------------------------------------------------------
1 | bsheedy@chromium.org
2 |
--------------------------------------------------------------------------------
/build/skia_gold_common/README.md:
--------------------------------------------------------------------------------
1 | This directory contains Python code used for interacting with the Skia Gold
2 | image diff service. It is used by multiple test harnesses, e.g.
3 | `//build/android/test_runner.py` and
4 | `//content/test/gpu/run_gpu_integration_test.py`. A place such as
5 | `//testing/` would likely be a better location, but causes issues with
6 | V8 since it imports `//build/` but not all of Chromium src.
7 |
--------------------------------------------------------------------------------
/build/skia_gold_common/__init__.py:
--------------------------------------------------------------------------------
1 | # Copyright 2020 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
--------------------------------------------------------------------------------
/build/toolchain/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/toolchain/concurrent_links.gni")
6 | import("//build/toolchain/rbe.gni")
7 |
8 | declare_args() {
9 | # Pool for non remote tasks.
10 | action_pool_depth = -1
11 | }
12 |
13 | if (current_toolchain == default_toolchain) {
14 | if (action_pool_depth == -1 || use_remoteexec) {
15 | action_pool_depth = exec_script("get_cpu_count.py", [], "value")
16 | }
17 |
18 | pool("link_pool") {
19 | depth = concurrent_links
20 | }
21 |
22 | pool("action_pool") {
23 | depth = action_pool_depth
24 | }
25 |
26 | pool("remote_action_pool") {
27 | depth = 1000
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/build/toolchain/OWNERS:
--------------------------------------------------------------------------------
1 | # Code Coverage.
2 | per-file *code_coverage*=pasthana@google.com
3 |
--------------------------------------------------------------------------------
/build/toolchain/aix/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2017 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/toolchain/gcc_toolchain.gni")
6 |
7 | gcc_toolchain("ppc64") {
8 | cc = "gcc"
9 | cxx = "g++"
10 |
11 | readelf = "readelf"
12 | nm = "nm"
13 | ar = "ar"
14 | ld = cxx
15 |
16 | toolchain_args = {
17 | current_cpu = "ppc64"
18 | current_os = "aix"
19 |
20 | # reclient does not support gcc.
21 | use_remoteexec = false
22 | is_clang = false
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/build/toolchain/android/DIR_METADATA:
--------------------------------------------------------------------------------
1 | mixins: "//build/android/COMMON_METADATA"
2 |
--------------------------------------------------------------------------------
/build/toolchain/android/OWNERS:
--------------------------------------------------------------------------------
1 | file://build/android/OWNERS
2 |
--------------------------------------------------------------------------------
/build/toolchain/apple/.style.yapf:
--------------------------------------------------------------------------------
1 | [style]
2 | based_on_style = pep8
3 |
--------------------------------------------------------------------------------
/build/toolchain/apple/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2021 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | import("//build/toolchain/concurrent_links.gni")
6 |
7 | declare_args() {
8 | # Reduce the number of tasks using the copy_bundle_data and compile_xcassets
9 | # tools as they can cause lots of I/O contention when invoking ninja with a
10 | # large number of parallel jobs (e.g. when using distributed build like rbe).
11 | bundle_pool_depth = -1
12 | }
13 |
14 | if (current_toolchain == default_toolchain) {
15 | pool("bundle_pool") {
16 | if (bundle_pool_depth == -1) {
17 | depth = concurrent_links
18 | } else {
19 | depth = bundle_pool_depth
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/build/toolchain/apple/OWNERS:
--------------------------------------------------------------------------------
1 | file://build/apple/OWNERS
2 |
--------------------------------------------------------------------------------
/build/toolchain/apple/get_tool_mtime.py:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 |
6 | import os
7 | import sys
8 |
9 | # Usage: python get_tool_mtime.py path/to/file1.py path/to/file2.py
10 | #
11 | # Prints a GN scope with the variable name being the basename sans-extension
12 | # and the value being the file modification time. A variable is emitted for
13 | # each file argument on the command line.
14 |
15 | if __name__ == '__main__':
16 | for f in sys.argv[1:]:
17 | variable = os.path.splitext(os.path.basename(f))[0]
18 | print('%s = %d' % (variable, os.path.getmtime(f)))
19 |
--------------------------------------------------------------------------------
/build/toolchain/apple/swift_const_gather_protocols.json:
--------------------------------------------------------------------------------
1 | ["AppIntent","EntityQuery","AppEntity","TransientEntity","AppEnum","AppShortcutProviding","AppShortcutsProvider","AnyResolverProviding","AppIntentsPackage","DynamicOptionsProvider"]
--------------------------------------------------------------------------------
/build/toolchain/cros/cros_config.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2023 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | declare_args() {
6 | # If set, build lacros with Chromium's toolchain instead of with Chrome OS's.
7 | # TODO(thakis): Set this to `= chromeos_is_browser_only` once that works.
8 | lacros_use_chromium_toolchain = false
9 |
10 | # Whether or not the toolchain used to build for ChromeOS needs
11 | # --rewrapper-path and --rewrapper-cfg arguments.
12 | # TODO(crbug.com/356466829): Remove this once we no longer use
13 | # ChromeOS's toolchain.
14 | cros_needs_rewrapper_path_arg = true
15 | }
16 |
--------------------------------------------------------------------------------
/build/toolchain/fuchsia/DIR_METADATA:
--------------------------------------------------------------------------------
1 | mixins: "//build/fuchsia/COMMON_METADATA"
2 |
--------------------------------------------------------------------------------
/build/toolchain/fuchsia/OWNERS:
--------------------------------------------------------------------------------
1 | file://build/fuchsia/OWNERS
2 |
--------------------------------------------------------------------------------
/build/toolchain/get_cpu_count.py:
--------------------------------------------------------------------------------
1 | # Copyright 2018 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | # This script shows cpu count to specify capacity of action pool.
6 |
7 |
8 | import multiprocessing
9 | import sys
10 |
11 | def main():
12 | try:
13 | cpu_count = multiprocessing.cpu_count()
14 | except:
15 | cpu_count = 1
16 |
17 | print(cpu_count)
18 | return 0
19 |
20 |
21 | if __name__ == '__main__':
22 | sys.exit(main())
23 |
--------------------------------------------------------------------------------
/build/toolchain/ios/OWNERS:
--------------------------------------------------------------------------------
1 | file://build/apple/OWNERS
2 |
--------------------------------------------------------------------------------
/build/toolchain/kythe.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2020 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | # This file defines configuration for Kythe, an indexer and cross-referencer
6 | # that powers codesearch.
7 |
8 | declare_args() {
9 | # Enables Kythe annotations necessary to build cross references.
10 | enable_kythe_annotations = false
11 | }
12 |
--------------------------------------------------------------------------------
/build/toolchain/mac/OWNERS:
--------------------------------------------------------------------------------
1 | file://build/apple/OWNERS
2 |
--------------------------------------------------------------------------------
/build/toolchain/siso.gni:
--------------------------------------------------------------------------------
1 | # Defines the configuration of siso (next-gen build system)
2 |
3 | use_siso_default = false
4 | if (current_toolchain == default_toolchain) {
5 | use_siso_default =
6 | exec_script(rebase_path("//build/toolchain/use_siso_default.py"),
7 | [],
8 | "value",
9 | [])
10 | }
11 |
12 | declare_args() {
13 | # Placeholder to allow having use_siso in args.gn file.
14 | # Explicit `use_siso` in args.gn can override default.
15 | use_siso = use_siso_default
16 | }
17 |
--------------------------------------------------------------------------------
/build/toolchain/win/rc/.gitignore:
--------------------------------------------------------------------------------
1 | linux64/rc
2 | mac/rc
3 | win/rc.exe
4 |
--------------------------------------------------------------------------------
/build/toolchain/win/rc/linux64/rc.sha1:
--------------------------------------------------------------------------------
1 | ca09f6f10b1943d3b5476fbb10b3d83d97f8f490
--------------------------------------------------------------------------------
/build/toolchain/win/rc/mac/rc.sha1:
--------------------------------------------------------------------------------
1 | 7993171a0945463597004878af3109ea97575b4f
--------------------------------------------------------------------------------
/build/toolchain/win/rc/win/rc.exe.sha1:
--------------------------------------------------------------------------------
1 | dea7da0d9bfcb8dad6cf53ca608dddac3459faaa
--------------------------------------------------------------------------------
/build/util/LASTCHANGE:
--------------------------------------------------------------------------------
1 | LASTCHANGE=7ee93c16afb9a87067ca55e1ec23b2ff88ab2dc7-refs/heads/main@{#1398428}
2 | LASTCHANGE_YEAR=2024
3 |
--------------------------------------------------------------------------------
/build/util/LASTCHANGE.committime:
--------------------------------------------------------------------------------
1 | 1734592570
--------------------------------------------------------------------------------
/build/util/LASTCHANGE.dummy:
--------------------------------------------------------------------------------
1 | LASTCHANGE=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000
2 |
--------------------------------------------------------------------------------
/build/util/chromium_git_revision.h.in:
--------------------------------------------------------------------------------
1 | // Copyright 2021 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | // chromium_git_revision.h is generated from chromium_git_revision.h.in. Edit
6 | // the source!
7 |
8 | #define CHROMIUM_GIT_REVISION "@@LASTCHANGE@"
9 |
--------------------------------------------------------------------------------
/build/util/lastchange.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2018 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | # This file is used to inject fixed dummy commit for commit independent
6 | # reproducible binaries.
7 |
8 | declare_args() {
9 | use_dummy_lastchange = !is_official_build
10 | }
11 |
12 | if (use_dummy_lastchange) {
13 | lastchange_file = "//build/util/LASTCHANGE.dummy"
14 | } else {
15 | lastchange_file = "//build/util/LASTCHANGE"
16 | }
17 |
--------------------------------------------------------------------------------
/build/util/lib/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yue/build-gn/0b9681cd9ea457b2262f279be30e1fbd4ea81ebd/build/util/lib/__init__.py
--------------------------------------------------------------------------------
/build/util/lib/common/PRESUBMIT.py:
--------------------------------------------------------------------------------
1 | # Copyright 2015 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 |
6 |
7 |
8 | def _RunTests(input_api, output_api):
9 | return (input_api.canned_checks.RunUnitTestsInDirectory(
10 | input_api, output_api, '.', files_to_check=[r'.+_test.py$']))
11 |
12 |
13 | def CheckChangeOnUpload(input_api, output_api):
14 | return _RunTests(input_api, output_api)
15 |
16 |
17 | def CheckChangeOnCommit(input_api, output_api):
18 | return _RunTests(input_api, output_api)
19 |
--------------------------------------------------------------------------------
/build/util/lib/common/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yue/build-gn/0b9681cd9ea457b2262f279be30e1fbd4ea81ebd/build/util/lib/common/__init__.py
--------------------------------------------------------------------------------
/build/util/lib/common/perf_result_data_type.py:
--------------------------------------------------------------------------------
1 | # Copyright 2013 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | DEFAULT = 'default'
6 | UNIMPORTANT = 'unimportant'
7 | HISTOGRAM = 'histogram'
8 | UNIMPORTANT_HISTOGRAM = 'unimportant-histogram'
9 | INFORMATIONAL = 'informational'
10 |
11 | ALL_TYPES = [DEFAULT, UNIMPORTANT, HISTOGRAM, UNIMPORTANT_HISTOGRAM,
12 | INFORMATIONAL]
13 |
14 |
15 | def IsValidType(datatype):
16 | return datatype in ALL_TYPES
17 |
18 |
19 | def IsHistogram(datatype):
20 | return (datatype == HISTOGRAM or datatype == UNIMPORTANT_HISTOGRAM)
21 |
--------------------------------------------------------------------------------
/build/util/lib/proto/OWNERS:
--------------------------------------------------------------------------------
1 | hypan@google.com
2 | zijiehe@google.com
3 |
--------------------------------------------------------------------------------
/build/util/lib/proto/README.md:
--------------------------------------------------------------------------------
1 | # Step to generate/update \*\_pb2.py stubs from proto
2 |
3 | 1. Install `protoc` if it is not in the `$PATH`
4 | 2. From this dir, Run the command `protoc --python_out=. *.proto` to generate
5 | python stubs
6 |
--------------------------------------------------------------------------------
/build/util/lib/proto/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yue/build-gn/0b9681cd9ea457b2262f279be30e1fbd4ea81ebd/build/util/lib/proto/__init__.py
--------------------------------------------------------------------------------
/build/util/lib/proto/average.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env vpython3
2 |
3 | # Copyright 2024 The Chromium Authors
4 | # Use of this source code is governed by a BSD-style license that can be
5 | # found in the LICENSE file.
6 | """ A metric implementation to calculate the average of the inputs. """
7 |
8 | from measure import Measure
9 | from test_script_metrics_pb2 import TestScriptMetric
10 |
11 |
12 | class Average(Measure):
13 |
14 | def __init__(self, name: str) -> None:
15 | self._name = name
16 | self._value = 0
17 | self._count = 0
18 |
19 | def record(self, value: float) -> None:
20 | self._value = (self._value * self._count + value) / (self._count + 1)
21 | self._count += 1
22 |
23 | def dump(self) -> TestScriptMetric:
24 | result = TestScriptMetric()
25 | result.name = self._name
26 | result.value = self._value
27 | return result
28 |
--------------------------------------------------------------------------------
/build/util/lib/proto/count.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env vpython3
2 |
3 | # Copyright 2024 The Chromium Authors
4 | # Use of this source code is governed by a BSD-style license that can be
5 | # found in the LICENSE file.
6 | """ A metric implementation to count the number of inputs. """
7 |
8 | from measure import Measure
9 | from test_script_metrics_pb2 import TestScriptMetric
10 |
11 |
12 | class Count(Measure):
13 |
14 | def __init__(self, name: str) -> None:
15 | self._name = name
16 | self._count = 0
17 |
18 | def record(self) -> None:
19 | self._count += 1
20 |
21 | def dump(self) -> TestScriptMetric:
22 | result = TestScriptMetric()
23 | result.name = self._name
24 | result.value = self._count
25 | return result
26 |
--------------------------------------------------------------------------------
/build/util/lib/proto/exception_occurrences.proto:
--------------------------------------------------------------------------------
1 | // Copyright 2024 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | syntax = "proto3";
6 |
7 | package build.util.lib.proto;
8 |
9 | import "google/protobuf/timestamp.proto";
10 |
11 | // Stored under the field "extended_properties" with key "exception_occurrences"
12 | // in the proto luci.resultdb.v1.Invocation
13 | // As a repeated message cannot fit directly into a google.protobuf.Struct,
14 | // Use "ExceptionOccurrences" message as a wrap.
15 | message ExceptionOccurrences {
16 | repeated ExceptionOccurrence datapoints = 1;
17 | }
18 |
19 | message ExceptionOccurrence {
20 | // The name of the exception.
21 | string name = 1;
22 | // The stacktrace associated with the exception.
23 | repeated string stacktrace = 2;
24 | // The time when this exception occurred.
25 | google.protobuf.Timestamp occurred_time = 3;
26 | }
27 |
--------------------------------------------------------------------------------
/build/util/lib/proto/measure.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env vpython3
2 |
3 | # Copyright 2024 The Chromium Authors
4 | # Use of this source code is governed by a BSD-style license that can be
5 | # found in the LICENSE file.
6 | """ The base class of all the measurement supported by the metric. """
7 |
8 | from abc import ABC, abstractmethod
9 | from test_script_metrics_pb2 import TestScriptMetric
10 |
11 |
12 | class Measure(ABC):
13 |
14 | @abstractmethod
15 | def dump(self) -> TestScriptMetric:
16 | """Dumps the data into a TestScriptMetric instance.
17 |
18 | Returns:
19 | TestScriptMetric: A protobuf instance to represent the metric data.
20 | """
21 |
--------------------------------------------------------------------------------
/build/util/lib/results/DIR_METADATA:
--------------------------------------------------------------------------------
1 | monorail: {
2 | component: "Infra>Client>Chrome"
3 | }
4 | buganizer_public: {
5 | component_id: 1456211
6 | }
7 |
--------------------------------------------------------------------------------
/build/util/lib/results/OWNERS:
--------------------------------------------------------------------------------
1 | bjoyce@chromium.org
2 |
--------------------------------------------------------------------------------
/build/util/lib/results/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yue/build-gn/0b9681cd9ea457b2262f279be30e1fbd4ea81ebd/build/util/lib/results/__init__.py
--------------------------------------------------------------------------------
/build/util/lib/results/result_types.py:
--------------------------------------------------------------------------------
1 | # Copyright 2021 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 | """Module containing base test results classes."""
5 |
6 | # The test passed.
7 | PASS = 'SUCCESS'
8 |
9 | # The test was intentionally skipped.
10 | SKIP = 'SKIPPED'
11 |
12 | # The test failed.
13 | FAIL = 'FAILURE'
14 |
15 | # The test caused the containing process to crash.
16 | CRASH = 'CRASH'
17 |
18 | # The test timed out.
19 | TIMEOUT = 'TIMEOUT'
20 |
21 | # The test ran, but we couldn't determine what happened.
22 | UNKNOWN = 'UNKNOWN'
23 |
24 | # The test did not run.
25 | NOTRUN = 'NOTRUN'
26 |
--------------------------------------------------------------------------------
/build/win/as_invoker.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/build/win/common_controls.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/build/win/require_administrator.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/build/win/segment_heap.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SegmentHeap
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/build/win/use_ansi_codes.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # Copyright 2015 The Chromium Authors
3 | # Use of this source code is governed by a BSD-style license that can be
4 | # found in the LICENSE file.
5 | """Prints if the the terminal is likely to understand ANSI codes."""
6 |
7 |
8 | import os
9 |
10 | # Add more terminals here as needed.
11 | print('ANSICON' in os.environ)
12 |
--------------------------------------------------------------------------------
/build_overrides/gtest.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2016 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | # Exclude support for registering main function in multi-process tests.
6 | gtest_include_multiprocess = true
7 |
8 | # Exclude support for platform-specific operations across unit tests.
9 | gtest_include_platform_test = true
10 |
11 | # Exclude support for testing Objective C code on OS X and iOS.
12 | gtest_include_objc_support = true
13 |
14 | # Exclude support for flushing coverage files on iOS.
15 | gtest_include_ios_coverage = true
16 |
--------------------------------------------------------------------------------
/buildtools/deps_revisions.gni:
--------------------------------------------------------------------------------
1 | # Copyright 2018 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | declare_args() {
6 | # Used to cause full rebuilds on libc++ rolls. This should be kept in sync
7 | # with the libcxx_revision var in //DEPS.
8 | libcxx_revision = "d0ddad5b79581e19d8e1aec627bb2ad86e1554cd"
9 | }
10 |
--------------------------------------------------------------------------------
/buildtools/linux64/ninja:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yue/build-gn/0b9681cd9ea457b2262f279be30e1fbd4ea81ebd/buildtools/linux64/ninja
--------------------------------------------------------------------------------
/buildtools/mac/ninja:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yue/build-gn/0b9681cd9ea457b2262f279be30e1fbd4ea81ebd/buildtools/mac/ninja
--------------------------------------------------------------------------------
/buildtools/third_party/eu-strip/OWNERS:
--------------------------------------------------------------------------------
1 | thestig@chromium.org
2 | thomasanderson@chromium.org
3 |
--------------------------------------------------------------------------------
/buildtools/third_party/eu-strip/README.chromium:
--------------------------------------------------------------------------------
1 | Name: eu-strip
2 | URL: https://sourceware.org/elfutils/
3 | Version: 0.158
4 | Security Critical: no
5 | Shipped: no
6 | License: LGPL 3
7 |
8 | Description:
9 |
10 | Patched eu-strip from elfutils.
11 |
12 | To build (on Trusty): ./build.sh in this directory.
13 |
--------------------------------------------------------------------------------
/buildtools/third_party/eu-strip/bin/eu-strip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yue/build-gn/0b9681cd9ea457b2262f279be30e1fbd4ea81ebd/buildtools/third_party/eu-strip/bin/eu-strip
--------------------------------------------------------------------------------
/buildtools/third_party/eu-strip/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh -xe
2 |
3 | rm -rf elfutils
4 | git clone git://sourceware.org/git/elfutils.git
5 | cd elfutils
6 | git checkout elfutils-0.170
7 | autoheader
8 | aclocal
9 | autoconf
10 | automake --add-missing
11 | patch -p1 < ../fix-elf-size.patch
12 | mkdir build
13 | cd build
14 | ../configure --enable-maintainer-mode
15 | make -j40
16 | gcc -std=gnu99 -Wall -Wshadow -Wunused -Wextra -fgnu89-inline \
17 | -Wformat=2 -Werror -g -O2 -Wl,-rpath-link,libelf:libdw -Wl,--build-id=none -o eu-strip \
18 | src/strip.o libebl/libebl.a libelf/libelf.a lib/libeu.a libdw/libdw.a -ldl -lz
19 | ./eu-strip -o ../../bin/eu-strip eu-strip
20 |
--------------------------------------------------------------------------------
/buildtools/third_party/libc++/OWNERS:
--------------------------------------------------------------------------------
1 | hans@chromium.org
2 | thakis@chromium.org
3 | thomasanderson@chromium.org
4 |
--------------------------------------------------------------------------------
/buildtools/third_party/libc++abi/OWNERS:
--------------------------------------------------------------------------------
1 | thakis@chromium.org
2 | thomasanderson@chromium.org
3 |
--------------------------------------------------------------------------------
/buildtools/third_party/libunwind/OWNERS:
--------------------------------------------------------------------------------
1 | # You may only be an owner of libunwind if your username begins with 'th'.
2 | thakis@chromium.org
3 | thomasanderson@chromium.org
4 |
--------------------------------------------------------------------------------
/buildtools/win/ninja.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yue/build-gn/0b9681cd9ea457b2262f279be30e1fbd4ea81ebd/buildtools/win/ninja.exe
--------------------------------------------------------------------------------
/examples/buildflag/.gn:
--------------------------------------------------------------------------------
1 | use_chromium_config = true
2 |
--------------------------------------------------------------------------------
/examples/buildflag/BUILD.gn:
--------------------------------------------------------------------------------
1 | import("//build/buildflag_header.gni")
2 |
3 | buildflag_header("some_buildflags") {
4 | header = "some/buildflags.h"
5 | flags = [ "SOME_FLAG=1" ]
6 | }
7 |
8 | executable("test") {
9 | sources = [
10 | "main.cc",
11 | ]
12 |
13 | deps = [
14 | ":some_buildflags",
15 | "//build:branding_buildflags",
16 | "//build:chromeos_buildflags",
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/examples/buildflag/main.cc:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "build/branding_buildflags.h"
4 | #include "build/build_config.h"
5 | #include "build/chromeos_buildflags.h"
6 | #include "some/buildflags.h"
7 |
8 | #if !BUILDFLAG(SOME_FLAG)
9 | static_assert("Flag not defined");
10 | #endif
11 |
12 | int main(int argc, const char *argv[]) {
13 | printf("Passed\n");
14 | return 0;
15 | }
16 |
--------------------------------------------------------------------------------
/examples/gtest/.gn:
--------------------------------------------------------------------------------
1 | use_chromium_config = true
2 |
--------------------------------------------------------------------------------
/examples/gtest/BUILD.gn:
--------------------------------------------------------------------------------
1 | import("//testing/test.gni")
2 |
3 | test("test") {
4 | sources = [
5 | "run_all_unittests.cc",
6 | "some_unittest.cc",
7 | ]
8 |
9 | deps = [ "//testing/gtest" ]
10 | }
11 |
--------------------------------------------------------------------------------
/examples/gtest/run_all_unittests.cc:
--------------------------------------------------------------------------------
1 | #include "testing/gtest/include/gtest/gtest.h"
2 |
3 | int main(int argc, char** argv) {
4 | ::testing::InitGoogleTest(&argc, argv);
5 | return RUN_ALL_TESTS();
6 | }
7 |
--------------------------------------------------------------------------------
/examples/gtest/some_unittest.cc:
--------------------------------------------------------------------------------
1 | #include "testing/gtest/include/gtest/gtest.h"
2 |
3 | namespace {
4 |
5 | bool g_init = false;
6 |
7 | } // namespace
8 |
9 | class SomeTest : public testing::Test {
10 | protected:
11 | void SetUp() override {
12 | g_init = true;
13 | }
14 | };
15 |
16 | TEST_F(SomeTest, Types) {
17 | EXPECT_TRUE(g_init);
18 | }
19 |
--------------------------------------------------------------------------------
/examples/libcxx/.gn:
--------------------------------------------------------------------------------
1 | use_chromium_config = true
2 |
3 | default_args = {
4 | is_clang = true
5 | use_xcode_clang = false
6 | use_custom_libcxx = true
7 | }
8 |
--------------------------------------------------------------------------------
/examples/libcxx/BUILD.gn:
--------------------------------------------------------------------------------
1 | executable("test") {
2 | sources = [
3 | "main.cc",
4 | ]
5 |
6 | deps = [
7 | "//build:branding_buildflags",
8 | "//build:chromeos_buildflags",
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/examples/libcxx/main.cc:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main(int argc, const char *argv[]) {
4 | printf("Passed\n");
5 | return 0;
6 | }
7 |
--------------------------------------------------------------------------------
/examples/simple/.gn:
--------------------------------------------------------------------------------
1 | use_chromium_config = true
2 |
--------------------------------------------------------------------------------
/examples/simple/BUILD.gn:
--------------------------------------------------------------------------------
1 | executable("test") {
2 | sources = [
3 | "main.cc",
4 | ]
5 |
6 | deps = [
7 | "//build:branding_buildflags",
8 | "//build:chromeos_buildflags",
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/examples/simple/main.cc:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include "build/branding_buildflags.h"
4 | #include "build/build_config.h"
5 | #include "build/chromeos_buildflags.h"
6 |
7 | int main(int argc, const char *argv[]) {
8 | printf("Passed\n");
9 | return 0;
10 | }
11 |
--------------------------------------------------------------------------------
/scripts/build.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | // Copyright 2016 Cheng Zhao. All rights reserved.
4 | // Use of this source code is governed by the license that can be found in the
5 | // LICENSE file.
6 |
7 | const {argv, verbose, execSync} = require('./common')
8 |
9 | let dir = 'out/Release'
10 | const args = argv.filter((arg) => {
11 | if (arg.startsWith('out')) {
12 | dir = arg
13 | return false;
14 | } else {
15 | return true;
16 | }
17 | })
18 |
19 | execSync(`ninja ${verbose ? '-v' : ''} -C ${dir} ${args.join(' ')}`)
20 |
--------------------------------------------------------------------------------
/third_party/catapult/tracing/BUILD.gn:
--------------------------------------------------------------------------------
1 | group("convert_chart_json") {
2 | }
3 |
--------------------------------------------------------------------------------
/third_party/depot_tools/gclient.py:
--------------------------------------------------------------------------------
1 | # PATCH(build-gn): Empty file to trick find_depot_tools.
2 |
--------------------------------------------------------------------------------
/third_party/googletest/DEPS:
--------------------------------------------------------------------------------
1 | # This file is a dummy used so that non-Chromium clients can specify
2 | # recursive DEPS. Otherwise the clients would need to nest DEPS inside
3 | # each other. Nested DEPS are not supported by gclient.
4 | #
5 | # Clients *must* specify googletest_revision when using this DEPS file.
6 |
7 | use_relative_paths = True
8 |
9 | vars = {
10 | 'chromium_git': 'https://chromium.googlesource.com',
11 |
12 | # We must specify a dummy variable here for recursedeps to work.
13 | 'googletest_revision': 'master',
14 | }
15 |
16 | deps = {
17 | 'src': '{chromium_git}/external/github.com/google/googletest.git@{googletest_revision}'
18 | }
19 |
--------------------------------------------------------------------------------
/third_party/googletest/DIR_METADATA:
--------------------------------------------------------------------------------
1 | monorail: {
2 | component: "Test>gTest"
3 | }
4 | buganizer_public: {
5 | component_id: 1457072
6 | }
7 |
--------------------------------------------------------------------------------
/third_party/googletest/OWNERS:
--------------------------------------------------------------------------------
1 | file://testing/gtest/OWNERS
2 |
--------------------------------------------------------------------------------
/third_party/googletest/custom/gtest/internal/custom/DEPS:
--------------------------------------------------------------------------------
1 | # This directory contains Google Test glue that depends on //base.
2 | include_rules = [
3 | '+base',
4 | '+build',
5 | ]
6 |
--------------------------------------------------------------------------------
/third_party/googletest/custom/gtest/internal/custom/chrome_custom_temp_dir.h:
--------------------------------------------------------------------------------
1 | // Copyright 2020 The Chromium Authors
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | #ifndef THIRD_PARTY_GOOGLETEST_CUSTOM_GTEST_INTERNAL_CUSTOM_CHROME_CUSTOM_TEMP_DIR_H_
6 | #define THIRD_PARTY_GOOGLETEST_CUSTOM_GTEST_INTERNAL_CUSTOM_CHROME_CUSTOM_TEMP_DIR_H_
7 |
8 | #include
9 |
10 | namespace testing {
11 | // Returns alternate temp directory for gtest.
12 | std::string ChromeCustomTempDir();
13 | } // namespace testing
14 |
15 | #endif // THIRD_PARTY_GOOGLETEST_CUSTOM_GTEST_INTERNAL_CUSTOM_CHROME_CUSTOM_TEMP_DIR_H_
16 |
--------------------------------------------------------------------------------
/third_party/libc++/OWNERS:
--------------------------------------------------------------------------------
1 | hans@chromium.org
2 | thakis@chromium.org
3 | thomasanderson@chromium.org
4 |
--------------------------------------------------------------------------------
/third_party/libc++/README.chromium:
--------------------------------------------------------------------------------
1 | Name: libcxx
2 | Short Name: libc++
3 | URL: http://libcxx.llvm.org/
4 | Version: 1.0
5 | License: MIT, University of Illinois/NCSA Open Source License
6 | License File: src/LICENSE.TXT
7 | Security Critical: yes
8 | Shipped: yes
9 |
10 | Description:
11 |
12 | libc++ for Chromium.
13 |
--------------------------------------------------------------------------------
/third_party/libc++/README.md:
--------------------------------------------------------------------------------
1 | The chromium build files for source files in third_party/libc++/src are in /buildtools/third_party/libc++
2 |
3 | TODO(crbug.com/1458042): After chromium/src is on Git Submodules, the builds files should be moved
4 | to this directory.
5 |
--------------------------------------------------------------------------------
/third_party/libc++abi/OWNERS:
--------------------------------------------------------------------------------
1 | thakis@chromium.org
2 | thomasanderson@chromium.org
3 |
--------------------------------------------------------------------------------
/third_party/libc++abi/README.chromium:
--------------------------------------------------------------------------------
1 | Name: libcxxabi
2 | Short Name: libc++abi
3 | URL: http://libcxxabi.llvm.org/
4 | Version: 1.0
5 | License: MIT, University of Illinois/NCSA Open Source License
6 | License File: src/LICENSE.TXT
7 | Security Critical: yes
8 | Shipped: yes
9 | Description:
10 | libc++abi for Chromium.
11 |
--------------------------------------------------------------------------------
/third_party/libc++abi/README.md:
--------------------------------------------------------------------------------
1 | The chromium build files for source files in third_party/libc++abi/src are /buildtools/third_party/libc++abi/.
2 |
3 | TODO(crbug.com/1458042): After chromium/src is on Git Submodules, the builds files should be moved
4 | to this directory.
5 |
--------------------------------------------------------------------------------
/third_party/libunwind/OWNERS:
--------------------------------------------------------------------------------
1 | thakis@chromium.org
2 | thomasanderson@chromium.org
3 |
--------------------------------------------------------------------------------
/third_party/libunwind/README.chromium:
--------------------------------------------------------------------------------
1 | Name: libunwind
2 | URL: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git
3 | Version: N/A
4 | Revision: DEPS
5 | License: MIT, University of Illinois/NCSA Open Source License
6 | License File: src/LICENSE.TXT
7 | Security Critical: yes
8 | Shipped: yes
9 | CPEPrefix: cpe:/a:libunwind_project:libunwind
10 |
11 | Description:
12 |
13 | libunwind for Chromium. This provides stack unwind functionality on Fuchsia and
14 | Android builds, and is additionally a dependency of libc++abi on Arm builds.
15 |
--------------------------------------------------------------------------------
/third_party/libunwind/README.md:
--------------------------------------------------------------------------------
1 | The chromium build files for source files in third_party/libunwind/src are /buildtools/third_party/libunwind/.
2 |
3 | TODO(crbug.com/1458042): After chromium/src is on Git Submodules, the builds files should be moved
4 | to this directory.
5 |
--------------------------------------------------------------------------------
/third_party/llvm-libc/BUILD.gn:
--------------------------------------------------------------------------------
1 | # Copyright 2024 The Chromium Authors
2 | # Use of this source code is governed by a BSD-style license that can be
3 | # found in the LICENSE file.
4 |
5 | config("config") {
6 | visibility = [ ":*" ]
7 | include_dirs = [ "src" ]
8 | defines = [ "LIBC_NAMESPACE=__llvm_libc_cr" ]
9 | }
10 |
11 | group("llvm-libc-shared") {
12 | # llvm-libc is only used as a dependency of libc++.
13 | visibility = [ "//buildtools/third_party/libc++:libc++" ]
14 |
15 | public_configs = [ ":config" ]
16 | }
17 |
--------------------------------------------------------------------------------
/third_party/llvm-libc/OWNERS:
--------------------------------------------------------------------------------
1 | file://third_party/libc++/OWNERS
2 |
--------------------------------------------------------------------------------
/third_party/llvm-libc/README.chromium:
--------------------------------------------------------------------------------
1 | Name: llvm-libc
2 | URL: https://libc.llvm.org/
3 | Version: N/A
4 | Revision: DEPS
5 | License: MIT, University of Illinois/NCSA Open Source License
6 | License File: src/LICENSE.TXT
7 | Security Critical: yes
8 | Shipped: yes
9 |
10 | Description:
11 |
12 | LLVM's C library. libc++ depends on a small subset of this for a few functions.
13 |
--------------------------------------------------------------------------------
/third_party/llvm-libc/README.md:
--------------------------------------------------------------------------------
1 | See README.chromium
2 |
--------------------------------------------------------------------------------
/tools/cfi/OWNERS:
--------------------------------------------------------------------------------
1 | eugenis@chromium.org
2 | pcc@chromium.org
3 |
--------------------------------------------------------------------------------