| # Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| # for details. All rights reserved. Use of this source code is governed by a |
| # BSD-style license that can be found in the LICENSE file. |
| |
| import("build/config/gclient_args.gni") |
| import("sdk_args.gni") |
| |
| # This target will be built if no target is specified when invoking ninja. |
| group("default") { |
| deps = [ ":runtime" ] |
| } |
| |
| group("most") { |
| deps = [ |
| ":analysis_server", |
| ":create_sdk", |
| ":dart2js", |
| ":dartanalyzer", |
| ":ddc", |
| ":runtime", |
| ] |
| } |
| |
| group("runtime") { |
| import("runtime/runtime_args.gni") |
| |
| deps = [ |
| "runtime/bin:dart", |
| "runtime/bin:dartvm", |
| "runtime/bin:ffi_test_dynamic_library", |
| "runtime/bin:ffi_test_functions", |
| "runtime/bin:process_test", |
| "runtime/bin:run_vm_tests", |
| "runtime/vm:kernel_platform_files($host_toolchain)", |
| "samples/embedder:kernel", |
| "samples/ffi/http:fake_http", |
| "samples/ffi/httpIG:fake_httpIG", |
| "utils/kernel-service", |
| ] |
| |
| # The following dependencies allow dartdev to start the resident frontend |
| # server and DDS. |
| if (dart_target_arch != "ia32" && dart_target_arch != "x86") { |
| deps += [ |
| "runtime/bin:dartaotruntime", |
| "runtime/bin:dartaotruntime_product", |
| "utils/dart_runtime_service_vm", |
| "utils/dart_runtime_service_vm:dart_runtime_service_vm_aot_snapshot", |
| "utils/dartdev:dartdev_aot_snapshot", |
| "utils/dds:dds_aot", |
| "utils/dtd:dtd_aot", |
| "utils/kernel-service:frontend_server_aot_product", |
| ] |
| } else { |
| deps += [ |
| "utils/dart_runtime_service_vm", |
| "utils/dartdev", |
| "utils/dds", |
| "utils/dtd", |
| "utils/kernel-service:frontend_server", |
| ] |
| } |
| |
| # AOT samples use dlopen to load AOT snapshots and it works only on |
| # 64-bit Linux right now. |
| if ((is_linux || is_mac) && |
| (dart_target_arch == "x64" || dart_target_arch == "arm64")) { |
| deps += [ "samples/embedder:aot" ] |
| } |
| |
| if (!is_win) { |
| # The test isn't run on windows |
| deps += [ "runtime/bin:entrypoints_verification_test" ] |
| } |
| |
| # This flag is set in runtime/runtime_args.gni |
| # The analyze_snapshot tool is only supported on 64 bit AOT builds running |
| # under linux and android platforms |
| if (build_analyze_snapshot) { |
| deps += [ |
| # The `analyze_snapshot` tests require the `analyze_snapshot` as well as |
| # `gen_snapshot` binaries. |
| "runtime/bin:analyze_snapshot", |
| "runtime/bin:analyze_snapshot($host_toolchain)", |
| "runtime/bin:gen_snapshot", |
| "runtime/bin:gen_snapshot($host_toolchain)", |
| ] |
| } |
| |
| if (is_linux || is_android) { |
| deps += [ "runtime/bin:abstract_socket_test" ] |
| } else if (is_fuchsia) { |
| deps += [ ":fuchsia_test_package" ] |
| } else if (is_win) { |
| deps += [ "runtime/bin:create_process_test_helper" ] |
| } |
| } |
| |
| # A separate target and not included in group("runtime"). This way the target\ |
| # "runtime" does not get many executables extra as build output. |
| group("run_ffi_unit_tests") { |
| deps = [ "runtime/bin/ffi_unit_test:run_ffi_unit_tests" ] |
| } |
| |
| group("runtime_precompiled") { |
| import("runtime/runtime_args.gni") |
| deps = [ |
| "runtime/bin:dartaotruntime", |
| "runtime/bin:gen_snapshot", |
| "runtime/bin:gen_snapshot($host_toolchain)", |
| "runtime/bin:process_test", |
| "runtime/vm:kernel_platform_files($host_toolchain)", |
| ] |
| if (is_linux || is_android) { |
| deps += [ "runtime/bin:abstract_socket_test" ] |
| } |
| if (dart_dynamic_modules) { |
| deps += [ "utils/dart2bytecode:dart2bytecode_snapshot" ] |
| deps += [ "utils/modular_aot_compiler:modular_aot_compiler_snapshot" ] |
| deps += [ "utils/dynamic_module_runner:dynamic_module_runner_snapshot" ] |
| } |
| } |
| |
| group("create_sdk") { |
| public_deps = [ "sdk:create_sdk" ] |
| } |
| |
| group("dart2js") { |
| import("runtime/runtime_args.gni") |
| if (dart_target_arch != "ia32" && dart_target_arch != "x86") { |
| deps = [ |
| ":runtime_precompiled", |
| "utils/compiler:dart2js_sdk_aot", |
| ] |
| } else { |
| deps = [ "utils/compiler:dart2js" ] |
| } |
| } |
| |
| group("dart2wasm_platform") { |
| deps = [ |
| ":runtime_precompiled", |
| "utils/dart2wasm:dart2wasm_js_compatibility_platform", |
| "utils/dart2wasm:dart2wasm_platform", |
| "utils/dart2wasm:dart2wasm_snapshot", |
| "utils/dart2wasm:dart2wasm_standalone_platform", |
| ] |
| if (defined(is_product)) { |
| if (is_product) { |
| deps += [ "utils/dart2wasm:dart2wasm_product_snapshot" ] |
| } else { |
| deps += [ "utils/dart2wasm:dart2wasm_asserts_snapshot" ] |
| } |
| } |
| } |
| |
| group("dart2wasm") { |
| deps = [ |
| ":dart2wasm_platform", |
| "utils/dart2wasm:test_wasm_modules", |
| ] |
| } |
| |
| group("dart2wasm_benchmark") { |
| deps = [ |
| ":dart2wasm_platform", |
| "third_party/binaryen:wasm-opt", |
| ] |
| } |
| |
| group("dartanalyzer") { |
| deps = [ "utils/dartanalyzer" ] |
| } |
| |
| group("ddc") { |
| import("runtime/runtime_args.gni") |
| if (dart_target_arch != "ia32" && dart_target_arch != "x86") { |
| deps = [ |
| ":runtime_precompiled", |
| "utils/bazel:kernel_worker_aot", |
| "utils/ddc:dartdevc_aot", |
| ] |
| } else { |
| deps = [ |
| "utils/bazel:kernel_worker", |
| "utils/ddc:dartdevc", |
| ] |
| } |
| } |
| |
| group("dartpad") { |
| deps = [ "utils/dartpad" ] |
| } |
| |
| group("analysis_server") { |
| deps = [ "utils/analysis_server" ] |
| } |
| |
| group("tools") { |
| deps = [ |
| "utils:bootstrap_compile_platform.exe", |
| "utils:bootstrap_gen_kernel.exe", |
| ] |
| } |
| |
| # This is the target that is built on the dart2js build bots. |
| # It must depend on anything that is required by the dart2js |
| # test suites. |
| group("dart2js_bot") { |
| deps = [ "sdk:create_most_sdk" ] |
| } |
| |
| group("dart2wasm_bot") { |
| deps = [ |
| "sdk:create_most_sdk", |
| "utils/dart2wasm:test_wasm_modules", |
| ] |
| } |
| |
| group("front-end_bot") { |
| deps = [ "sdk:create_most_sdk" ] |
| } |
| |
| group("analyzer_bot") { |
| deps = [ |
| "sdk:create_most_sdk", |
| "utils/dartanalyzer", |
| ] |
| } |
| |
| group("benchmark_bot") { |
| deps = [ |
| ":dart2wasm_benchmark", |
| "runtime/bin:run_vm_tests", |
| "sdk:create_most_sdk", |
| "utils/ddc:ddc_canary_test", |
| "utils/ddc:ddc_stable_test", |
| "utils/kernel-service", |
| ] |
| } |
| |
| group("pkg_bot") { |
| deps = [ |
| ":create_sdk", |
| ":dartpad", |
| ] |
| } |
| |
| group("android_bot") { |
| deps = [ |
| "runtime/bin:abstract_socket_test", |
| "runtime/bin:dartaotruntime", |
| "runtime/bin:dartvm", |
| "runtime/bin:ffi_test_dynamic_library", |
| "runtime/bin:ffi_test_functions", |
| "runtime/bin:gen_snapshot($host_toolchain)", |
| "runtime/bin:process_test", |
| "runtime/bin:run_vm_tests", |
| "samples/ffi/http:fake_http", |
| "samples/ffi/httpIG:fake_httpIG", |
| ] |
| } |
| |
| group("dartfuzz") { |
| deps = [ |
| "runtime/bin:dartaotruntime", |
| "runtime/bin:dartvm", |
| "utils/compiler:dart2js_platform", |
| "utils/dart2wasm:dart2wasm_platform", |
| "utils/kernel-service", |
| ] |
| } |
| |
| group("iso_stress") { |
| deps = [ |
| "runtime/bin:dartaotruntime", |
| "runtime/bin:dartvm", |
| "runtime/bin:ffi_test_dynamic_library", |
| "runtime/bin:ffi_test_functions", |
| "runtime/bin:process_test", |
| ] |
| } |
| |
| if (is_fuchsia) { |
| import("third_party/fuchsia/gn-sdk/src/component.gni") |
| import("third_party/fuchsia/gn-sdk/src/package.gni") |
| import("utils/aot_snapshot.gni") |
| import("utils/application_snapshot.gni") |
| |
| # TODO(b/399714829): Test packages should be created at test-time, not |
| # build-time. |
| |
| # tests/ffi/**_test.dart except those with compile-time errors |
| ffi_test_sources = rebase_path(exec_script("tools/list_dart_tests.py", |
| [ rebase_path("tests/ffi/") ], |
| "list lines"), |
| ".", |
| root_build_dir) |
| ffi_test_sources -= [ |
| "tests/ffi/abi_specific_int_incomplete_aot_test.dart", |
| "tests/ffi/abi_specific_int_incomplete_jit_test.dart", |
| "tests/ffi/isolate_group_bound_callback_test.dart", |
| "tests/ffi/isolate_group_bound_init_test.dart", |
| "tests/ffi/run_isolate_group_run_test.dart", |
| "tests/ffi/static_checks/address_of_cast_test.dart", |
| "tests/ffi/static_checks/address_position_cascade_test.dart", |
| "tests/ffi/static_checks/regress_44985_test.dart", |
| "tests/ffi/static_checks/regress_44986_test.dart", |
| "tests/ffi/static_checks/regress_46085_test.dart", |
| "tests/ffi/static_checks/regress_47673_2_test.dart", |
| "tests/ffi/static_checks/regress_51041_test.dart", |
| "tests/ffi/static_checks/regress_60250_test.dart", |
| "tests/ffi/static_checks/regress_62693_test.dart", |
| "tests/ffi/static_checks/regress_62716_test.dart", |
| "tests/ffi/static_checks/regress_flutter_188175_test.dart", |
| "tests/ffi/static_checks/vmspecific_function_callbacks_negative_test.dart", |
| "tests/ffi/static_checks/vmspecific_regress_38993_test.dart", |
| "tests/ffi/static_checks/vmspecific_static_checks_address_of_test.dart", |
| "tests/ffi/static_checks/vmspecific_static_checks_array_test.dart", |
| "tests/ffi/static_checks/vmspecific_static_checks_ffinative_test.dart", |
| "tests/ffi/static_checks/vmspecific_static_checks_native_test.dart", |
| "tests/ffi/static_checks/vmspecific_static_checks_test.dart", |
| "tests/ffi/static_checks/vmspecific_static_checks_varargs_test.dart", |
| "tests/ffi/static_checks/vmspecific_variance_function_checks_test.dart", |
| "tests/ffi/threading_pinning_test.dart", |
| "tests/ffi/threading_reentrant_test.dart", |
| "tests/ffi/threading_runeventloop_test.dart", |
| "tests/ffi/threading_test.dart", |
| ] |
| |
| # tests/standalone/io/**_test.dart except those with compile-time errors |
| io_test_sources = rebase_path( |
| exec_script("tools/list_dart_tests.py", |
| [ rebase_path("tests/standalone/io/", root_build_dir) ], |
| "list lines"), |
| ".", |
| root_build_dir) |
| io_test_sources -= [] |
| |
| jit_test_sources = ffi_test_sources |
| aot_test_sources = ffi_test_sources |
| if (current_cpu == "x64") { |
| jit_test_sources += io_test_sources |
| } else { |
| not_needed(io_test_sources) |
| } |
| |
| test_deps = [] |
| test_resources = [] |
| foreach(test_source, jit_test_sources) { |
| label = string_replace(test_source, "/", "_") |
| application_snapshot(label) { |
| dart_snapshot_kind = "kernel" |
| main_dart = test_source |
| training_args = [] # Not used |
| output = "$target_out_dir/$test_source.dill" |
| } |
| test_deps += [ ":$label" ] |
| test_resources += [ |
| { |
| path = "$target_out_dir/$test_source.dill" |
| dest = "data/$test_source" |
| }, |
| ] |
| } |
| foreach(test_source, aot_test_sources) { |
| label = string_replace(test_source, "/", "_") + "_aot" |
| aot_snapshot(label) { |
| main_dart = test_source |
| output = "$target_out_dir/$test_source.elf" |
| } |
| test_deps += [ ":$label" ] |
| test_resources += [ |
| { |
| path = "$target_out_dir/$test_source.elf" |
| dest = "data/$test_source.elf" |
| }, |
| ] |
| } |
| |
| test_binaries = [ |
| "dartvm", |
| "dartaotruntime", |
| ] |
| |
| foreach(binary, test_binaries) { |
| fuchsia_component("${binary}_test_component") { |
| manifest = "runtime/bin/${binary}_test_component.cml" |
| data_deps = [ |
| "runtime/bin:${binary}", |
| "runtime/bin:ffi_callback_stub_bin", |
| "runtime/bin:ffi_test_dynamic_library", |
| "runtime/bin:ffi_test_functions", |
| ] |
| library_files = [ |
| "libffi_test_dynamic_library.so", |
| "libffi_test_functions.so", |
| ] |
| resource_files = [ |
| ".dart_tool/package_config.json", |
| "tests/standalone/io/addlatexhash_test_src.tex", |
| "tests/standalone/io/certificates/bad_server_chain.pem", |
| "tests/standalone/io/certificates/bad_server_key.pem", |
| "tests/standalone/io/certificates/client1.p12", |
| "tests/standalone/io/certificates/client1.pem", |
| "tests/standalone/io/certificates/client1_key.p12", |
| "tests/standalone/io/certificates/client1_key.pem", |
| "tests/standalone/io/certificates/client1_key_malformed.pem", |
| "tests/standalone/io/certificates/client2.pem", |
| "tests/standalone/io/certificates/client2_key.pem", |
| "tests/standalone/io/certificates/client_authority.p12", |
| "tests/standalone/io/certificates/client_authority.pem", |
| "tests/standalone/io/certificates/client_authority_malformed.pem", |
| "tests/standalone/io/certificates/server_chain.p12", |
| "tests/standalone/io/certificates/server_chain.pem", |
| "tests/standalone/io/certificates/server_chain_malformed1.pem", |
| "tests/standalone/io/certificates/server_chain_malformed2.pem", |
| "tests/standalone/io/certificates/server_key.p12", |
| "tests/standalone/io/certificates/server_key.pem", |
| "tests/standalone/io/certificates/server_trusted.pem", |
| "tests/standalone/io/certificates/trusted_certs.p12", |
| "tests/standalone/io/certificates/trusted_certs.pem", |
| "tests/standalone/io/certificates/trusted_certs_malformed.pem", |
| "tests/standalone/io/certificates/untrusted_server_chain.pem", |
| "tests/standalone/io/certificates/untrusted_server_key.pem", |
| "tests/standalone/io/create_sample_certificates.sh", |
| "tests/standalone/io/empty_file", |
| "tests/standalone/io/file_test.txt", |
| "tests/standalone/io/fixed_length_file", |
| "tests/standalone/io/fixed_length_file_out", |
| "tests/standalone/io/localhost.crt", |
| "tests/standalone/io/localhost.key", |
| "tests/standalone/io/read_as_text.dat", |
| "tests/standalone/io/readline_test1.dat", |
| "tests/standalone/io/readline_test2.dat", |
| "tests/standalone/io/readuntil_test.dat", |
| "tests/standalone/io/sample_certificate_v3_extensions", |
| ] |
| resources = [] |
| foreach(file, library_files) { |
| resources += [ |
| { |
| path = root_out_dir + "/" + file |
| dest = "lib/" + file |
| }, |
| ] |
| } |
| resources += [ |
| { |
| path = get_label_info("runtime/bin:ffi_callback_stub_bin", |
| "target_out_dir") + "/ffi_callback_stub.bin" |
| dest = "lib/ffi_callback_stub.bin" |
| }, |
| ] |
| foreach(file, resource_files) { |
| resources += [ |
| { |
| path = file |
| dest = "data/" + file |
| }, |
| ] |
| } |
| deps = test_deps |
| resources += test_resources |
| |
| # Should the GN SDK be doing this? |
| if (current_cpu == "x64") { |
| triple = "x86_64-unknown-fuchsia" |
| } else if (current_cpu == "arm64") { |
| triple = "aarch64-unknown-fuchsia" |
| } else if (current_cpu == "riscv64") { |
| triple = "riscv64-unknown-fuchsia" |
| } else { |
| assert(false, "What cpu?") |
| } |
| if (is_asan) { |
| resources += [ |
| { |
| path = "//third_party/fuchsia/sdk/linux/arch/$current_cpu/sysroot/dist/lib/asan/ld.so.1" |
| dest = "lib/asan/ld.so.1" |
| }, |
| { |
| path = "//buildtools/linux-x64/clang/lib/clang/23/lib/$triple/libclang_rt.asan.so" |
| dest = "lib/libclang_rt.asan.so" |
| }, |
| ] |
| } else if (is_ubsan) { |
| resources += [ |
| { |
| path = "//buildtools/linux-x64/clang/lib/clang/23/lib/$triple/libclang_rt.ubsan_standalone.so" |
| dest = "lib/libclang_rt.ubsan_standalone.so" |
| }, |
| ] |
| } else { |
| not_needed([ "triple" ]) |
| } |
| } |
| } |
| |
| fuchsia_package("fuchsia_test_package") { |
| package_name = "dart_test" |
| deps = [] |
| foreach(binary, test_binaries) { |
| deps += [ ":${binary}_test_component" ] |
| } |
| } |
| } |
| |
| if (is_linux && current_cpu != "riscv32") { |
| group("debian_package") { |
| public_deps = [ "tools/debian_package" ] |
| } |
| } |