diff --git a/BUILD.gn b/BUILD.gn index 09f0f392d3668654709d254d2c986db05af67077..3832dd71616e709c1b66dd99c72c21b95a6d409d 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -496,9 +496,40 @@ if (defined(ohos_lite)) { sources += [ "src/os-ohos.c" ] } - shared_library("libunwind") { - deps = [ ":unwind_source" ] + lite_library("libunwind") { + target_type = "shared_library" + + # deps = [ ":unwind_source" ] public_configs = [ ":unwind_config_public" ] + configs = [] + sources = common_source + + if (target_cpu == "arm") { + # no jump lib + arm_source -= [ + "src/arm/getcontext.S", + "src/arm/siglongjmp.S", + ] + + # as libc++ is static linked with libunwind.a + # we remove the Gstep.c for duplicated symbol violation + sources += arm_source + configs += [ ":unwind_config_arm" ] + } else if (target_cpu == "arm64") { + sources += arm64_source + configs += [ ":unwind_config_arm64" ] + } else if (target_cpu == "riscv64") { + sources += riscv64_source + configs += [ ":unwind_config_riscv64" ] + } else if (target_cpu == "x64") { + sources += x64_source + configs += [ ":unwind_config_x64" ] + } else if (target_cpu == "x86_64") { + sources += x64_source + configs += [ ":unwind_config_x86_64" ] + } + + sources += [ "src/os-ohos.c" ] } static_library("libunwind_local") { diff --git a/bundle.json b/bundle.json index 9089153410f73a1b90aa38bb728ef682bd704497..118e37d0e6fe0bac4a2c23dd57e1068c5d16f0af 100644 --- a/bundle.json +++ b/bundle.json @@ -23,8 +23,21 @@ }, "build": { "sub_component": [], - "inner_kits": [], - "test": [ "//third_party/libunwind:unittest" ] + "inner_kits": [ + { + "name": "//third_party/libunwind:libunwind", + "header": { + "header_files": [], + "header_base": [ + "//third_party/libunwind/src", + "//third_party/libunwind/include" + ] + } + } + ], + "test": [ + "//third_party/libunwind:unittest" + ] } } } \ No newline at end of file