diff --git a/BUILD.gn b/BUILD.gn index 14dd2cb922f98e97b1f945a9cc8d94a51dd7c1dc..3f37107be89acaa745b0b0903db394a029154c28 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -53,8 +53,12 @@ ohos_shared_library("protobuf_lite") { "src/google/protobuf/**/*.inc", "src", ] - if (current_toolchain != host_toolchain) { - external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + if (!is_mingw) { + if (current_toolchain != host_toolchain) { + external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + } + } else { + defines = [ "_FILE_OFFSET_BITS_SET_LSEEK" ] } cflags_cc = [ "-Wno-sign-compare" ] @@ -104,10 +108,14 @@ ohos_static_library("protobuf_lite_static") { "src/google/protobuf/**/*.inc", "src", ] - if (default_toolchain == current_toolchain) { - # target build, not host build - defines = [ "HAVE_HILOG" ] - external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + if (!is_mingw) { + if (default_toolchain == current_toolchain) { + # target build, not host build + defines = [ "HAVE_HILOG" ] + external_deps = [ "hiviewdfx_hilog_native:libhilog" ] + } + } else { + defines = [ "_FILE_OFFSET_BITS_SET_LSEEK" ] } cflags_cc = [ "-Wno-sign-compare" ]