From 6da8fd72573f915fe51b392d5d300fca6382014d Mon Sep 17 00:00:00 2001 From: lordwithcc Date: Tue, 19 Jul 2022 17:08:29 +0800 Subject: [PATCH] Remove ark template Relate Issue:https://gitee.com/openharmony/arkcompiler_ets_frontend/issues/I5GIJE Signed-off-by: lordwithcc --- ets_frontend_config.gni | 2 +- ts2panda/ts2abc/BUILD.gn | 128 ++++++++++++++++++------------------- ts2panda/ts2abc_config.gni | 7 +- 3 files changed, 68 insertions(+), 69 deletions(-) diff --git a/ets_frontend_config.gni b/ets_frontend_config.gni index b4a3c1928a1..df6b9e1b4f9 100644 --- a/ets_frontend_config.gni +++ b/ets_frontend_config.gni @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -if (defined(ark_independent_build)) { +if (defined(ark_standalone_build)) { ets_frontend_root = "//ets_frontend" } else { build_root = "//build" diff --git a/ts2panda/ts2abc/BUILD.gn b/ts2panda/ts2abc/BUILD.gn index 7e723caf01b..a9403fd94f2 100755 --- a/ts2panda/ts2abc/BUILD.gn +++ b/ts2panda/ts2abc/BUILD.gn @@ -11,16 +11,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -if (!defined(ark_independent_build)) { +if (!defined(ark_standalone_build)) { import("//arkcompiler/runtime_core/ark_config.gni") import("//build/ohos.gni") + jsoncpp_root = "$ark_third_party_root/jsoncpp" } else { import("//runtime_core/ark_config.gni") import("$build_root/ark.gni") + jsoncpp_root = "//third_party/jsoncpp" } -jsoncpp_root = "$ark_third_party_root/jsoncpp" - config("ts2abc_config") { visibility = [ ":*" ] include_dirs = [ @@ -56,11 +56,11 @@ 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", + "$jsoncpp_root/src/lib_json/json_reader.cpp", + "$jsoncpp_root/src/lib_json/json_value.cpp", + "$jsoncpp_root/src/lib_json/json_writer.cpp", ] - public_configs = [ "$jsoncpp_root:jsoncpp_config" ] + public_configs = [ "$ark_third_party_root/jsoncpp:jsoncpp_config" ] public_configs += [ ":flag_config" ] include_dirs = [ "$jsoncpp_root/include", @@ -68,75 +68,73 @@ source_set("jsoncpp_set_static") { ] } -if (!defined(ark_independent_build)) { - ohos_static_library("jsoncpp_static") { - deps = [ ":jsoncpp_set_static" ] - use_exceptions = true - subsystem_name = "ark" - part_name = "ark_frontend_tool" - } +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", - "type_adapter.cpp", - ] +ohos_executable("ts2abc") { + sources = [ + "main.cpp", + "ts2abc.cpp", + "type_adapter.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 = [ sdk_libc_secshared_dep ] + deps = [ sdk_libc_secshared_dep ] + if (!ark_standalone_build) { + deps += + [ "//arkcompiler/ets_frontend/merge_abc:panda_assembly_proto_static" ] + } - 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", + "$ark_third_party_root/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", + "$ark_third_party_root/jsoncpp: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" - install_enable = true - subsystem_name = "ark" - } -} else { - ark_static_library("jsoncpp_static") { - deps = [ ":jsoncpp_set_static" ] } + + output_name = "js2abc" + install_enable = true + subsystem_name = "ark" } diff --git a/ts2panda/ts2abc_config.gni b/ts2panda/ts2abc_config.gni index 01d9002487e..3ffb0ef7808 100755 --- a/ts2panda/ts2abc_config.gni +++ b/ts2panda/ts2abc_config.gni @@ -10,15 +10,16 @@ # 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 (!defined(ark_standalone_build)) { + import("//arkcompiler/ets_frontend/ets_frontend_config.gni") import("//build/ohos.gni") import("//build/test.gni") build_root = "//build" ts2abc_root = "//arkcompiler/ets_frontend/ts2panda" } else { + import("//ets_frontend/ets_frontend_config.gni") import("$build_root/ark.gni") - ts2abc_root = "//arkcompiler/ets_frontend/ts2panda" + ts2abc_root = "//ets_frontend/ts2panda" } declare_args() { -- Gitee