diff --git a/es2panda/BUILD.gn b/es2panda/BUILD.gn index 27fea7ea4208a96b46d975639ac5f06dbb825394..cdd8549c960ba87629994e508e3b9c9f52c2f1c5 100644 --- a/es2panda/BUILD.gn +++ b/es2panda/BUILD.gn @@ -12,8 +12,14 @@ # limitations under the License. import("//arkcompiler/ets_frontend/ets_frontend_config.gni") +if (!ark_standalone_build) { + import("//build/ohos.gni") + third_party_gn_path = "//third_party" +} else { + import("$build_root/ark.gni") + third_party_gn_path = "//arkcompiler/toolchain/build/third_party_gn" +} import("//arkcompiler/runtime_core/ark_config.gni") -import("//build/ohos.gni") es2panda_src = [ "es2panda.cpp", @@ -339,7 +345,7 @@ isa_gen = "${ark_root}/isa/gen.rb" isa_gen_data = "$root_gen_dir/isa/isa.yaml" isa_gen_require = "${ark_root}/isa/isapi.rb" action_foreach("gen_isa_headers") { - deps = [ "//arkcompiler/runtime_core/isa:isa_combine" ] + deps = [ "$ark_root/isa:isa_combine" ] template_files = [ "isa.h.erb", @@ -395,7 +401,7 @@ ohos_static_library("es2panda_lib") { "$ark_root/libpandabase:libarkbase_frontend_static", "$ark_root/libpandafile:libarkfile_frontend_static", "$ark_root/libziparchive:libarkziparchive_frontend_static", - "//third_party/icu/icu4c:static_icuuc", + "$third_party_gn_path/icu/icu4c:static_icuuc", ] if (enable_bytecode_optimizer) { @@ -550,12 +556,14 @@ group("es2panda_build") { } } -group("es2panda_build_win") { - deps = [ ":es2panda(${toolchain_win})" ] -} +if (!ark_standalone_build) { + group("es2panda_build_win") { + deps = [ ":es2panda(${toolchain_win})" ] + } -group("es2abc_tests") { - deps = [ "./test:es2abc_parser_tests" ] - deps += [ "./test:es2abc_parser_tsc_tests" ] - deps += [ "./test:es2abc_compiler_tests" ] + group("es2abc_tests") { + deps = [ "./test:es2abc_parser_tests" ] + deps += [ "./test:es2abc_parser_tsc_tests" ] + deps += [ "./test:es2abc_compiler_tests" ] + } } diff --git a/es2panda/es2abc_config.gni b/es2panda/es2abc_config.gni index 5c1786c68a038ff6e45bf9f2836d53f731ce91b7..b377c4f09f1bf155fa1a24f79448dcbb8d205e74 100644 --- a/es2panda/es2abc_config.gni +++ b/es2panda/es2abc_config.gni @@ -12,13 +12,12 @@ # limitations under the License. import("//arkcompiler/ets_frontend/ets_frontend_config.gni") -if (defined(ark_independent_build)) { +es2abc_root = "//arkcompiler/ets_frontend/es2panda" +if (ark_standalone_build) { import("$build_root/ark.gni") - es2abc_root = "//ets_frontend/es2panda" } else { import("//build/ohos.gni") build_root = "//build" - es2abc_root = "//arkcompiler/ets_frontend/es2panda" } es2abc_build_path = "" diff --git a/ets_frontend_config.gni b/ets_frontend_config.gni index b4a3c1928a180a9b5d115404362e4f3fb50ec4b0..cda68185cc3a07134de02f61760f0a4b84774db1 100644 --- a/ets_frontend_config.gni +++ b/ets_frontend_config.gni @@ -11,11 +11,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -if (defined(ark_independent_build)) { - ets_frontend_root = "//ets_frontend" -} else { +if (!defined(ark_standalone_build)) { build_root = "//build" - ets_frontend_root = "//arkcompiler/ets_frontend" + ark_standalone_build = false } toolchain_linux = "$build_root/toolchain/linux:clang_x64" diff --git a/merge_abc/BUILD.gn b/merge_abc/BUILD.gn index 3b928ff1c4e7d3f99f092d8847622e688da1ae1c..fa641a22e3e8c74988be3858e2a0934c338b2007 100644 --- a/merge_abc/BUILD.gn +++ b/merge_abc/BUILD.gn @@ -12,10 +12,16 @@ # limitations under the License. import("//arkcompiler/ets_frontend/ets_frontend_config.gni") +if (!ark_standalone_build) { + import("//build/config/clang/clang.gni") + import("//build/ohos.gni") + import("//developtools/profiler/build/config.gni") +} else { + import("//profiler//build/config.gni") + import("$build_root/ark.gni") + import("$build_root/config/clang/clang.gni") +} import("//arkcompiler/runtime_core/ark_config.gni") -import("//build/config/clang/clang.gni") -import("//build/ohos.gni") -import("//developtools/profiler/build/config.gni") proto_base_dir = "protos" proto_out_dir = "$target_gen_dir" + "/protos_generated" @@ -106,7 +112,7 @@ host_protoc_path = root_out_dir + host_out_path + "/" + protoc_binary_out_path + "/protoc" action("arkcompiler_generate_proto") { - deps = [ "//third_party/protobuf:protoc($host_toolchain)" ] + deps = [ "$ark_third_party_root/protobuf:protoc($host_toolchain)" ] args = [] sources = [] outputs = proto_generated_header + proto_generated_source @@ -137,8 +143,8 @@ ohos_source_set("assembly_proto_static") { deps = [ ":arkcompiler_generate_proto", - "//third_party/protobuf:protobuf_lite_static", - "//third_party/protobuf:protobuf_static", + "$ark_third_party_root/protobuf:protobuf_lite_static", + "$ark_third_party_root/protobuf:protobuf_static", ] sources = proto_generated_header + proto_generated_source + @@ -176,7 +182,7 @@ ohos_executable("merge_abc") { "$ark_root/libpandabase:libarkbase_frontend_static", "$ark_root/libpandafile:libarkfile_frontend_static", "$ark_root/libziparchive:libarkziparchive_frontend_static", - "//third_party/icu/icu4c:static_icuuc", + "$ark_third_party_root/icu/icu4c:static_icuuc", ] ldflags = [] @@ -281,6 +287,8 @@ group("merge_proto_abc_build") { } } -group("merge_proto_abc_build_win") { - deps = [ ":merge_abc(${toolchain_win})" ] +if (!ark_standalone_build) { + group("merge_proto_abc_build_win") { + deps = [ ":merge_abc(${toolchain_win})" ] + } } diff --git a/ts2panda/ts2abc/BUILD.gn b/ts2panda/ts2abc/BUILD.gn index 5653deaadf3708f92af84bb5da70494d7107d3b2..183da27eea35a0f1bd6bdf2f30b44b8cff68f841 100755 --- a/ts2panda/ts2abc/BUILD.gn +++ b/ts2panda/ts2abc/BUILD.gn @@ -11,13 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -if (!defined(ark_independent_build)) { - import("//arkcompiler/runtime_core/ark_config.gni") - import("//build/ohos.gni") -} else { - import("//runtime_core/ark_config.gni") - import("$build_root/ark.gni") -} +import("//arkcompiler/runtime_core/ark_config.gni") +import("//build/ohos.gni") jsoncpp_root = "$ark_third_party_root/jsoncpp" @@ -69,69 +64,67 @@ source_set("jsoncpp_set_static") { ] } -if (!defined(ark_independent_build)) { - ohos_static_library("jsoncpp_static") { - deps = [ ":jsoncpp_set_static" ] - use_exceptions = true - part_name = "ets_frontend" - subsystem_name = "arkcompiler" - } +ohos_static_library("jsoncpp_static") { + deps = [ ":jsoncpp_set_static" ] + use_exceptions = true + subsystem_name = "ark" + part_name = "ark_frontend_tool" +} - ohos_executable("ts2abc") { - sources = [ - "main.cpp", - "ts2abc.cpp", - ] +ohos_executable("ts2abc") { + sources = [ + "main.cpp", + "ts2abc.cpp", + ] - configs = [ ":ts2abc_config" ] + configs = [ ":ts2abc_config" ] - cflags = [ - "-Wno-c++20-designator", - "-Wno-c99-extensions", - "-Wno-unknown-warning-option", - ] + cflags = [ + "-Wno-c++20-designator", + "-Wno-c99-extensions", + "-Wno-unknown-warning-option", + ] - deps = [ - "//arkcompiler/ets_frontend/merge_abc:panda_assembly_proto_static", - sdk_libc_secshared_dep, - ] + deps = [ + "//arkcompiler/ets_frontend/merge_abc:panda_assembly_proto_static", + sdk_libc_secshared_dep, + ] - if (is_linux || is_mingw || is_mac) { + if (is_linux || is_mingw || is_mac) { + deps += [ + "$ark_root/assembler:libarkassembler_frontend_static", + "$ark_root/libpandabase:libarkbase_frontend_static", + "$ark_root/libpandafile:libarkfile_frontend_static", + "$ark_root/libziparchive:libarkziparchive_frontend_static", + "//third_party/jsoncpp:jsoncpp_static", + ] + if (enable_bytecode_optimizer) { deps += [ - "$ark_root/assembler:libarkassembler_frontend_static", - "$ark_root/libpandabase:libarkbase_frontend_static", - "$ark_root/libpandafile:libarkfile_frontend_static", - "$ark_root/libziparchive:libarkziparchive_frontend_static", - "//third_party/jsoncpp:jsoncpp_static", + "$ark_root/bytecode_optimizer:libarkbytecodeopt_frontend_static", + "$ark_root/compiler:libarkcompiler_frontend_static", ] - if (enable_bytecode_optimizer) { - deps += [ - "$ark_root/bytecode_optimizer:libarkbytecodeopt_frontend_static", - "$ark_root/compiler:libarkcompiler_frontend_static", - ] - } - } else { + } + } else { + deps += [ + "$ark_root/assembler:libarkassembler", + "$ark_root/libpandabase:libarkbase", + "$ark_root/libpandafile:libarkfile", + "$ark_root/libziparchive:libarkziparchive", + "$jsoncpp_root:jsoncpp", + ] + if (enable_bytecode_optimizer) { deps += [ - "$ark_root/assembler:libarkassembler", - "$ark_root/libpandabase:libarkbase", - "$ark_root/libpandafile:libarkfile", - "$ark_root/libziparchive:libarkziparchive", - "$jsoncpp_root:jsoncpp", + "$ark_root/bytecode_optimizer:libarkbytecodeopt", + "$ark_root/compiler:libarkcompiler", ] - if (enable_bytecode_optimizer) { - deps += [ - "$ark_root/bytecode_optimizer:libarkbytecodeopt", - "$ark_root/compiler:libarkcompiler", - ] - } } + } - if (is_linux) { - if (build_public_version) { - ldflags = [ "-static-libstdc++" ] - } else { - libs = [ libcpp_static_lib ] - } + if (is_linux) { + if (build_public_version) { + ldflags = [ "-static-libstdc++" ] + } else { + libs = [ libcpp_static_lib ] } output_name = "js2abc" @@ -139,8 +132,4 @@ if (!defined(ark_independent_build)) { part_name = "ets_frontend" subsystem_name = "arkcompiler" } -} else { - ark_static_library("jsoncpp_static") { - deps = [ ":jsoncpp_set_static" ] - } } diff --git a/ts2panda/ts2abc_config.gni b/ts2panda/ts2abc_config.gni index 01d9002487e336478430b860b36fbc909642af8a..0455085264482faf324a6ca7b12b4dea3a690071 100755 --- a/ts2panda/ts2abc_config.gni +++ b/ts2panda/ts2abc_config.gni @@ -10,15 +10,14 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + import("//arkcompiler/ets_frontend/ets_frontend_config.gni") -if (!defined(ark_independent_build)) { +ts2abc_root = "//arkcompiler/ets_frontend/ts2panda" +if (!ark_standalone_build) { import("//build/ohos.gni") import("//build/test.gni") - build_root = "//build" - ts2abc_root = "//arkcompiler/ets_frontend/ts2panda" } else { import("$build_root/ark.gni") - ts2abc_root = "//arkcompiler/ets_frontend/ts2panda" } declare_args() {