diff --git a/ts2panda/ts2abc/BUILD.gn b/ts2panda/ts2abc/BUILD.gn index 7e723caf01bfcc095669284ce680668e04f63a47..9e9fe6b70df2c69d165df5a87d2b064202f25b8e 100755 --- a/ts2panda/ts2abc/BUILD.gn +++ b/ts2panda/ts2abc/BUILD.gn @@ -14,13 +14,13 @@ if (!defined(ark_independent_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 = [ @@ -68,75 +68,69 @@ 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 (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" - 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" }