diff --git a/ts2panda/ts2abc/BUILD.gn b/ts2panda/ts2abc/BUILD.gn index 8718d3e7a178be3e01d9ce36771e2ccf7de7f7f4..062624fd21ae325fd699e9bde2795e20d94af16f 100755 --- a/ts2panda/ts2abc/BUILD.gn +++ b/ts2panda/ts2abc/BUILD.gn @@ -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)) { import("//ark/runtime_core/ark_config.gni") import("//build/ohos.gni") } else { @@ -68,74 +68,76 @@ 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", - ] +ohos_executable("ts2abc") { + sources = [ + "main.cpp", + "ts2abc.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 = [ + "-fPIE", + "-ldl", + "-lpthread", + "-lrt", + "-lc++", + "-latomic", + "-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 496060cae95629a1433558aa91baf010307e063c..416a121f48041e5ac376ffa2479e2d5b331c9b67 100755 --- a/ts2panda/ts2abc_config.gni +++ b/ts2panda/ts2abc_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)) { import("//build/ohos.gni") import("//build/test.gni") build_root = "//build"