diff --git a/ts2panda/ts2abc/BUILD.gn b/ts2panda/ts2abc/BUILD.gn index daa0c2853dec3419304d4557395cdbd5aa3cbde1..08bb3083bb87114f259bc5823351aced2ed51377 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 9cd6af7ce38424add1bea85d0f7c4e4c3af1f5a7..3bf3a00fd4cf5bebb0f02b353f9c3d26ee291ee2 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/" }