From 7350020a26f07badacc8fce6de5f2a11c1efd29f Mon Sep 17 00:00:00 2001 From: songhao Date: Wed, 20 Apr 2022 18:25:55 +0800 Subject: [PATCH] =?UTF-8?q?4.20=E5=90=8C=E6=AD=A5=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: songhao --- ts2panda/ts2abc/BUILD.gn | 49 +++++++++++++++++++++++--------------- ts2panda/ts2abc_config.gni | 17 ++++++++----- 2 files changed, 41 insertions(+), 25 deletions(-) diff --git a/ts2panda/ts2abc/BUILD.gn b/ts2panda/ts2abc/BUILD.gn index daa0c2853d..08bb3083bb 100755 --- a/ts2panda/ts2abc/BUILD.gn +++ b/ts2panda/ts2abc/BUILD.gn @@ -11,10 +11,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//ark/runtime_core/ark_config.gni") -import("//build/ohos.gni") +if (!defined(ark_flag)) { + import("//ark/runtime_core/ark_config.gni") + import("//build/ohos.gni") +} else { + import("//build/ark.gni") + import("//runtime_core/ark_config.gni") +} -jsoncpp_root = "//third_party/jsoncpp" +jsoncpp_root = "$ark_third_party_root/jsoncpp" config("ts2abc_config") { visibility = [ ":*" ] @@ -100,23 +105,15 @@ source_set("ts2abc_static") { } } -ohos_executable("ts2abc") { - deps = [ ":ts2abc_static" ] - - output_name = "js2abc" - install_enable = true - subsystem_name = "ark" -} - config("flag_config") { cflags_cc = [ "-fexceptions" ] } source_set("jsoncpp_set_static") { sources = [ - "//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", + "$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", ] public_configs = [ "$jsoncpp_root:jsoncpp_config" ] public_configs += [ ":flag_config" ] @@ -126,9 +123,23 @@ source_set("jsoncpp_set_static") { ] } -ohos_static_library("jsoncpp_static") { - deps = [ ":jsoncpp_set_static" ] - use_exceptions = true - subsystem_name = "ark" - part_name = "ark_frontend_tool" +if (!defined(ark_flag)) { + ohos_static_library("jsoncpp_static") { + deps = [ ":jsoncpp_set_static" ] + use_exceptions = true + subsystem_name = "ark" + part_name = "ark_frontend_tool" + } + + ohos_executable("ts2abc") { + deps = [ ":ts2abc_static" ] + + output_name = "js2abc" + install_enable = true + subsystem_name = "ark" + } +} else { + ark_static_library("jsoncpp_static") { + deps = [ ":jsoncpp_set_static" ] + } } diff --git a/ts2panda/ts2abc_config.gni b/ts2panda/ts2abc_config.gni index 9cd6af7ce3..3bf3a00fd4 100755 --- a/ts2panda/ts2abc_config.gni +++ b/ts2panda/ts2abc_config.gni @@ -11,15 +11,20 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//build/ohos.gni") -import("//build/test.gni") +if (!defined(ark_flag)) { + import("//build/ohos.gni") + import("//build/test.gni") + ts2abc_root = "//ark/ts2abc/ts2panda" +} else { + import("//build/ark.gni") + ts2abc_root = "//ts2abc/ts2panda" +} declare_args() { buildtool_linux = "//build/toolchain/linux:clang_x64" buildtool_mac = "//build/toolchain/mac:clang_x64" buildtool_win = "//build/toolchain/mingw:mingw_x86_64" - ts2abc_root = "//ark/ts2abc/ts2panda" nodejs_dir = "" node_path = "" node_modules = "" @@ -39,18 +44,18 @@ if (build_public_version) { if (host_toolchain == buildtool_mac) { ts2abc_build_deps = [ "$ts2abc_root:ts2abc_build_mac($buildtool_mac)" ] ts2abc_build_path = - get_label_info("//ark/ts2abc/ts2panda:ts2abc_build_mac($buildtool_mac)", + get_label_info("$ts2abc_root:ts2abc_build_mac($buildtool_mac)", "root_out_dir") + "/obj/ark/ts2abc/ts2panda/build-mac" node_path = "${nodejs_dir}/node-v12.18.4-darwin-x64/bin/" } else if (host_toolchain == buildtool_win) { ts2abc_build_deps = [ "$ts2abc_root:ts2abc_build_win($buildtool_win)" ] ts2abc_build_path = - get_label_info("//ark/ts2abc/ts2panda:ts2abc_build_win($buildtool_win)", + get_label_info("$ts2abc_root:ts2abc_build_win($buildtool_win)", "root_out_dir") + "/obj/ark/ts2abc/ts2panda/build_win" } else { ts2abc_build_deps = [ "$ts2abc_root:ts2abc_build($buildtool_linux)" ] ts2abc_build_path = - get_label_info("//ark/ts2abc/ts2panda:ts2abc_build($buildtool_linux)", + get_label_info("$ts2abc_root:ts2abc_build($buildtool_linux)", "root_out_dir") + "/obj/ark/ts2abc/ts2panda/build" node_path = "${nodejs_dir}/node-v12.18.4-linux-x64/bin/" } -- Gitee