diff --git a/assembler/BUILD.gn b/assembler/BUILD.gn index 9d02b3a..6f111ef 100644 --- a/assembler/BUILD.gn +++ b/assembler/BUILD.gn @@ -47,10 +47,10 @@ libarkassembler_configs = [ "$ark_root/libpandafile:arkfile_public_config", ] -ohos_shared_library("libarkassembler") { +source_set("libarkassembler_static") { sources = libarkassembler_sources - configs = libarkassembler_configs + public_configs = libarkassembler_configs deps = [ ":ark_asm_ecmascript_meta_gen_h", @@ -65,6 +65,10 @@ ohos_shared_library("libarkassembler") { "$ark_root/libpandafile:libarkfile", sdk_libc_secshared_dep, ] +} + +ohos_shared_library("libarkassembler") { + deps = [ ":libarkassembler_static" ] if (!is_standard_system) { relative_install_dir = "ark" } @@ -76,10 +80,10 @@ ohos_shared_library("libarkassembler") { part_name = "ark" } -ohos_static_library("libarkassembler_frontend_static") { +source_set("libarkassembler_frontend_set_static") { sources = libarkassembler_sources - configs = libarkassembler_configs + public_configs = libarkassembler_configs deps = [ ":ark_asm_ecmascript_meta_gen_h", @@ -94,17 +98,21 @@ ohos_static_library("libarkassembler_frontend_static") { "$ark_root/libpandafile:libarkfile_frontend_static", sdk_libc_secshared_dep, ] +} + +ohos_static_library("libarkassembler_frontend_static") { + deps = [ ":libarkassembler_frontend_set_static" ] subsystem_name = "ark" part_name = "ark" } -ohos_executable("ark_asm") { +source_set("ark_asm_static") { sources = [ "pandasm.cpp" ] include_dirs = [ "$target_gen_dir" ] - configs = [ + public_configs = [ sdk_libc_secshared_config, ":arkassembler_public_config", "$ark_root:ark_config", @@ -122,6 +130,10 @@ ohos_executable("ark_asm") { if (!is_mac && !is_mingw && !ark_standalone_build) { ldflags = [ "-static-libstdc++" ] } +} + +ohos_executable("ark_asm") { + deps = [ ":ark_asm_static" ] install_enable = true subsystem_name = "ark" diff --git a/dprof/BUILD.gn b/dprof/BUILD.gn index eadf956..41d8695 100644 --- a/dprof/BUILD.gn +++ b/dprof/BUILD.gn @@ -22,14 +22,14 @@ config("libdprof_config") { ] } -ohos_static_library("libdprof") { +source_set("libdprof_static") { sources = [ "libdprof/dprof/ipc/ipc_message.cpp", "libdprof/dprof/ipc/ipc_unix_socket.cpp", "libdprof/dprof/profiling_data.cpp", ] - configs = [ + public_configs = [ "$ark_root:ark_config", "$ark_root/libpandabase:arkbase_public_config", sdk_libc_secshared_config, @@ -37,6 +37,10 @@ ohos_static_library("libdprof") { ] deps = [ "$ark_root/libpandabase:libarkbase" ] +} + +ohos_static_library("libdprof") { + deps = [ ":libdprof_static" ] subsystem_name = "ark" part_name = "ark" diff --git a/libpandabase/BUILD.gn b/libpandabase/BUILD.gn index c01c492..60f1272 100644 --- a/libpandabase/BUILD.gn +++ b/libpandabase/BUILD.gn @@ -129,12 +129,24 @@ libarkbase_deps = [ sdk_libc_secshared_dep, ] -ohos_shared_library("libarkbase") { +source_set("libarkbase_static") { sources = libarkbase_sources - configs = libarkbase_configs + public_configs = libarkbase_configs deps = libarkbase_deps +} + +source_set("libarkbase_frontend_set_static") { + sources = libarkbase_sources + + public_configs = libarkbase_configs + + deps = libarkbase_deps +} + +ohos_shared_library("libarkbase") { + deps = [ ":libarkbase_static" ] output_extension = "so" if (is_mingw) { @@ -148,11 +160,7 @@ ohos_shared_library("libarkbase") { } ohos_static_library("libarkbase_frontend_static") { - sources = libarkbase_sources - - configs = libarkbase_configs - - deps = libarkbase_deps + deps = [ ":libarkbase_frontend_set_static" ] subsystem_name = "ark" part_name = "ark" diff --git a/libpandafile/BUILD.gn b/libpandafile/BUILD.gn index fda5097..b703cca 100644 --- a/libpandafile/BUILD.gn +++ b/libpandafile/BUILD.gn @@ -57,10 +57,10 @@ libarkfile_configs = [ ":arkfile_public_config", ] -ohos_shared_library("libarkfile") { +source_set("libarkfile_static") { sources = libarkfile_sources - configs = libarkfile_configs + public_configs = libarkfile_configs deps = [ ":isa_gen_libarkfile_bytecode_emitter_def_gen_h", @@ -74,6 +74,10 @@ ohos_shared_library("libarkfile") { "$ark_root/libziparchive:libarkziparchive", sdk_libc_secshared_dep, ] +} + +ohos_shared_library("libarkfile") { + deps = [ ":libarkfile_static" ] if (!is_standard_system) { relative_install_dir = "ark" @@ -86,10 +90,10 @@ ohos_shared_library("libarkfile") { part_name = "ark" } -ohos_static_library("libarkfile_frontend_static") { +source_set("libarkfile_frontend_set_static") { sources = libarkfile_sources - configs = libarkfile_configs + public_configs = libarkfile_configs deps = [ ":isa_gen_libarkfile_bytecode_emitter_def_gen_h", @@ -103,6 +107,10 @@ ohos_static_library("libarkfile_frontend_static") { "$ark_root/libziparchive:libarkziparchive_frontend_static", sdk_libc_secshared_dep, ] +} + +ohos_static_library("libarkfile_frontend_static") { + deps = [ ":libarkfile_frontend_set_static" ] part_name = "ark" subsystem_name = "ark" diff --git a/libziparchive/BUILD.gn b/libziparchive/BUILD.gn index 8f52906..01c048a 100644 --- a/libziparchive/BUILD.gn +++ b/libziparchive/BUILD.gn @@ -30,10 +30,10 @@ config("arkziparchive_config") { } } -ohos_shared_library("libarkziparchive") { +source_set("libarkziparchive_static") { sources = [ "zip_archive.cpp" ] - configs = [ + public_configs = [ ":arkziparchive_config", "$ark_root:ark_config", sdk_libc_secshared_config, @@ -49,6 +49,11 @@ ohos_shared_library("libarkziparchive") { } else { deps += [ "$ark_third_party_root/miniz:libminiz" ] } +} + +ohos_shared_library("libarkziparchive") { + deps = [ ":libarkziparchive_static" ] + if (!is_standard_system) { relative_install_dir = "ark" } @@ -60,10 +65,10 @@ ohos_shared_library("libarkziparchive") { part_name = "ark" } -ohos_static_library("libarkziparchive_frontend_static") { +source_set("libarkziparchive_frontend_set_static") { sources = [ "zip_archive.cpp" ] - configs = [ + public_configs = [ ":arkziparchive_config", "$ark_root:ark_config", sdk_libc_secshared_config, @@ -79,6 +84,10 @@ ohos_static_library("libarkziparchive_frontend_static") { } else { deps += [ "$ark_third_party_root/miniz:libminiz" ] } +} + +ohos_static_library("libarkziparchive_frontend_static") { + deps = [ ":libarkziparchive_frontend_set_static" ] subsystem_name = "ark" part_name = "ark" diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index c5637a1..c8a3812 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -63,7 +63,7 @@ group("arkruntime_header_deps") { ] } -ohos_static_library("libarkruntime_static") { +source_set("libarkruntime_set_static") { sources = [ "arch/asm_support.cpp", "assert_gc_scope.cpp", @@ -217,7 +217,7 @@ ohos_static_library("libarkruntime_static") { sources += core_vm_sources sources += verifier_sources - configs = [ + public_configs = [ "$ark_root:ark_config", "$ark_root/libpandabase:arkbase_public_config", "$ark_root/libpandafile:arkfile_public_config", @@ -269,6 +269,10 @@ ohos_static_library("libarkruntime_static") { current_cpu == "x86_64") { ldflags = [ "-latomic" ] } +} + +ohos_static_library("libarkruntime_static") { + deps = [ ":libarkruntime_set_static" ] output_extension = "a" subsystem_name = "ark" @@ -322,10 +326,10 @@ config("arkruntime_interpreter_impl_config") { } } -ohos_static_library("arkruntime_interpreter_impl") { +source_set("arkruntime_interpreter_impl_static") { sources = [ "interpreter/interpreter_impl.cpp" ] - configs = [ + public_configs = [ "$ark_root:ark_config", "$ark_root/libpandabase:arkbase_public_config", "$ark_root/libpandafile:arkfile_public_config", @@ -339,6 +343,10 @@ ohos_static_library("arkruntime_interpreter_impl") { "$ark_root/libpandabase:libarkbase", "$ark_root/libpandafile:libarkfile", ] +} + +ohos_static_library("arkruntime_interpreter_impl") { + deps = [ ":arkruntime_interpreter_impl_static" ] subsystem_name = "ark" part_name = "ark"