diff --git a/BUILD.gn b/BUILD.gn index ca7e3b03edc3470131ebf1b4502b5b9f8d5f0eb1..f6072501df51b8834d7389122f52b4d9bfc5ae0e 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -136,6 +136,9 @@ ohos_static_library("protobuf_lite_static") { "-Wno-sign-compare", "-Wno-deprecated-declarations", ] + if (host_os == "mac") { + cflags_cc += [ "-faligned-allocation" ] + } cflags = [ "-Wno-deprecated-declarations", "-Wno-sign-compare", @@ -299,6 +302,9 @@ ohos_static_library("protobuf_static") { "-Wno-sign-compare", "-Wno-deprecated-declarations", ] + if (host_os == "mac") { + cflags_cc += [ "-faligned-allocation" ] + } cflags = [ "-Wno-sign-compare", "-D HAVE_PTHREAD",