From 47a9afebaa4b871282f9f7ef91f55aa1bfd3b74e Mon Sep 17 00:00:00 2001 From: wengchangcheng Date: Mon, 24 Oct 2022 23:55:56 +0800 Subject: [PATCH] Descriptor: Fix standalone build error Details: Modify gn and some template Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I5XGZ4 Signed-off-by: wengchangcheng Change-Id: I1437984773e9bb0a6c849a4026653891fde769c1 --- es2panda/BUILD.gn | 3 +-- es2panda/es2abc_config.gni | 9 +-------- es2panda/test/BUILD.gn | 1 - ets_frontend_config.gni | 16 ++++++++++++---- merge_abc/BUILD.gn | 10 ++++------ ts2panda/BUILD.gn | 2 -- ts2panda/ts2abc/BUILD.gn | 20 +++++--------------- ts2panda/ts2abc_config.gni | 3 ++- 8 files changed, 25 insertions(+), 39 deletions(-) diff --git a/es2panda/BUILD.gn b/es2panda/BUILD.gn index 27fea7ea42..86804569e5 100644 --- a/es2panda/BUILD.gn +++ b/es2panda/BUILD.gn @@ -13,7 +13,6 @@ import("//arkcompiler/ets_frontend/ets_frontend_config.gni") import("//arkcompiler/runtime_core/ark_config.gni") -import("//build/ohos.gni") es2panda_src = [ "es2panda.cpp", @@ -395,7 +394,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", + "$ark_third_party_root/icu/icu4c:static_icuuc", ] if (enable_bytecode_optimizer) { diff --git a/es2panda/es2abc_config.gni b/es2panda/es2abc_config.gni index 5c1786c68a..c46973d596 100644 --- a/es2panda/es2abc_config.gni +++ b/es2panda/es2abc_config.gni @@ -12,15 +12,8 @@ # limitations under the License. import("//arkcompiler/ets_frontend/ets_frontend_config.gni") -if (defined(ark_independent_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_root = "//arkcompiler/ets_frontend/es2panda" es2abc_build_path = "" es2abc_build_deps = "" es2abc_out_root = "" diff --git a/es2panda/test/BUILD.gn b/es2panda/test/BUILD.gn index e3753c2c8e..b8c6c5c20e 100644 --- a/es2panda/test/BUILD.gn +++ b/es2panda/test/BUILD.gn @@ -13,7 +13,6 @@ import("//arkcompiler/ets_frontend/es2panda/es2abc_config.gni") import("//arkcompiler/ets_runtime/js_runtime_config.gni") -import("//build/ohos.gni") action("es2abc_parser_tests") { script = "${es2abc_root}/test/runner.py" diff --git a/ets_frontend_config.gni b/ets_frontend_config.gni index b4a3c1928a..f09625004a 100644 --- a/ets_frontend_config.gni +++ b/ets_frontend_config.gni @@ -11,13 +11,21 @@ # 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)) { + ark_standalone_build = false +} + +if (!ark_standalone_build) { build_root = "//build" - ets_frontend_root = "//arkcompiler/ets_frontend" + ark_third_party_root = "//third_party" + import("$build_root/ohos.gni") +} else { + ark_third_party_root = "//arkcompiler/toolchain/build/third_party_gn" + import("$build_root/ark.gni") } +ets_frontend_root = "//arkcompiler/ets_frontend" + toolchain_linux = "$build_root/toolchain/linux:clang_x64" if (host_cpu == "arm64") { toolchain_mac = "$build_root/toolchain/mac:clang_arm64" diff --git a/merge_abc/BUILD.gn b/merge_abc/BUILD.gn index 3b928ff1c4..be0d3d7297 100644 --- a/merge_abc/BUILD.gn +++ b/merge_abc/BUILD.gn @@ -13,8 +13,6 @@ import("//arkcompiler/ets_frontend/ets_frontend_config.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" @@ -106,7 +104,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 +135,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 +174,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 = [] diff --git a/ts2panda/BUILD.gn b/ts2panda/BUILD.gn index d1ef4ebfd5..c5f498c329 100755 --- a/ts2panda/BUILD.gn +++ b/ts2panda/BUILD.gn @@ -13,8 +13,6 @@ import("//arkcompiler/ets_frontend/ts2panda/ts2abc_config.gni") import("//arkcompiler/runtime_core/ark_config.gni") -import("//build/config/clang/clang.gni") -import("//build/ohos.gni") src_dir = target_out_dir + "/src" src_dir_full_path = rebase_path("${ts2abc_root}/src") diff --git a/ts2panda/ts2abc/BUILD.gn b/ts2panda/ts2abc/BUILD.gn index 5653deaadf..19f7bc1a7b 100755 --- a/ts2panda/ts2abc/BUILD.gn +++ b/ts2panda/ts2abc/BUILD.gn @@ -11,13 +11,7 @@ # 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") jsoncpp_root = "$ark_third_party_root/jsoncpp" @@ -57,9 +51,9 @@ config("flag_config") { source_set("jsoncpp_set_static") { sources = [ - "$ark_third_party_root/jsoncpp/src/lib_json/json_reader.cpp", - "$ark_third_party_root/jsoncpp/src/lib_json/json_value.cpp", - "$ark_third_party_root/jsoncpp/src/lib_json/json_writer.cpp", + "//third_party/jsoncpp/src/lib_json/json_reader.cpp", + "//third_party/jsoncpp/src/lib_json/json_value.cpp", + "//third_party/jsoncpp/src/lib_json/json_writer.cpp", ] public_configs = [ "$jsoncpp_root:jsoncpp_config" ] public_configs += [ ":flag_config" ] @@ -69,7 +63,7 @@ source_set("jsoncpp_set_static") { ] } -if (!defined(ark_independent_build)) { +if (!ark_standalone_build) { ohos_static_library("jsoncpp_static") { deps = [ ":jsoncpp_set_static" ] use_exceptions = true @@ -139,8 +133,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 01d9002487..b1c7f692eb 100755 --- a/ts2panda/ts2abc_config.gni +++ b/ts2panda/ts2abc_config.gni @@ -10,8 +10,9 @@ # 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)) { +if (!ark_standalone_build) { import("//build/ohos.gni") import("//build/test.gni") build_root = "//build" -- Gitee