1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-13 03:09:51 +03:00
aports/community/grpc/disable-sse2-on-arm.patch
2025-03-29 22:55:37 +00:00

27 lines
1.3 KiB
Diff

# Work around https://github.com/grpc/grpc/issues/37976
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 391d113eab..aa6e3d41ae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -268,7 +268,7 @@ set(gRPC_USE_PROTO_LITE OFF CACHE BOOL "Use the protobuf-lite library")
if(UNIX)
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(_gRPC_PLATFORM_LINUX ON)
- if(NOT CMAKE_CROSSCOMPILING AND CMAKE_SIZEOF_VOID_P EQUAL 4)
+ if(CMAKE_SYSTEM_PROCESSOR MATCHES "i[3-6]86" AND CMAKE_SIZEOF_VOID_P EQUAL 4)
message("+++ Enabling SSE2 for ${CMAKE_SYSTEM_PROCESSOR}")
set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} -msse2")
endif()
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
index d80675afc4..fb6a46daa1 100644
--- a/templates/CMakeLists.txt.template
+++ b/templates/CMakeLists.txt.template
@@ -374,7 +374,7 @@
if(UNIX)
if(<%text>${CMAKE_SYSTEM_NAME}</%text> MATCHES "Linux")
set(_gRPC_PLATFORM_LINUX ON)
- if(NOT CMAKE_CROSSCOMPILING AND CMAKE_SIZEOF_VOID_P EQUAL 4)
+ if(CMAKE_SYSTEM_PROCESSOR MATCHES "i[3-6]86" AND CMAKE_SIZEOF_VOID_P EQUAL 4)
message("+++ Enabling SSE2 for <%text>${CMAKE_SYSTEM_PROCESSOR}</%text>")
set(_gRPC_C_CXX_FLAGS "<%text>${_gRPC_C_CXX_FLAGS}</%text> -msse2")
endif()