Skip to content

Commit 8bc9d1b

Browse files
committed
Build protoc only to build arch
1 parent 8d3c3f9 commit 8bc9d1b

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

transports/http3-quiche/CMakeLists.txt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,24 @@ set(ABSL_PROPAGATE_CXX_STD ON)
2929
# include abseil
3030
set(ABSL_MSVC_STATIC_RUNTIME ON)
3131
add_subdirectory(third_party/abseil-cpp EXCLUDE_FROM_ALL)
32-
IF(APPLE)
33-
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "Build architectures for Mac OS X" FORCE)
34-
ENDIF(APPLE)
3532

3633

3734
# include protobuf
3835
SET(protobuf_WITH_ZLIB OFF CACHE BOOL "Build with zlib support")
3936
SET(protobuf_BUILD_TESTS OFF CACHE BOOL "Build tests off")
4037
set(protobuf_INSTALL OFF CACHE BOOL "Install protobuf off" FORCE)
4138
add_subdirectory(third_party/protobuf EXCLUDE_FROM_ALL)
42-
IF(APPLE)
43-
set_target_properties(protoc libprotoc libprotobuf PROPERTIES OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "Build architectures for Mac OS X" FORCE )
44-
ENDIF(APPLE)
39+
if(APPLE)
40+
execute_process(
41+
COMMAND uname -m
42+
OUTPUT_VARIABLE HOST_ARCH
43+
OUTPUT_STRIP_TRAILING_WHITESPACE
44+
)
45+
set_target_properties(protoc libprotoc libprotobuf
46+
PROPERTIES
47+
OSX_ARCHITECTURES "${HOST_ARCH}"
48+
)
49+
endif()
4550

4651
IF (WIN32)
4752
add_compile_definitions(WIN32_LEAN_AND_MEAN NOGDI)

0 commit comments

Comments
 (0)