Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit f872b43

Browse files
authored
Protobuf_USE_STATIC_LIBS must be set on Apple too (#18851)
Fixes #18840
1 parent 4bb8224 commit f872b43

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

CMakeLists.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,14 @@ else()
148148
execute_process(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE SYSTEM_ARCHITECTURE)
149149
endif()
150150

151-
if(CMAKE_BUILD_TYPE STREQUAL "Distribution" AND UNIX AND NOT APPLE)
152-
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
153-
set(CMAKE_INSTALL_RPATH $\{ORIGIN\})
154-
# Enforce DT_PATH instead of DT_RUNPATH
155-
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--disable-new-dtags")
156-
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--disable-new-dtags")
151+
if(CMAKE_BUILD_TYPE STREQUAL "Distribution")
152+
if(UNIX AND NOT APPLE)
153+
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
154+
set(CMAKE_INSTALL_RPATH $\{ORIGIN\})
155+
# Enforce DT_PATH instead of DT_RUNPATH
156+
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--disable-new-dtags")
157+
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--disable-new-dtags")
158+
endif()
157159
set(Protobuf_USE_STATIC_LIBS ON)
158160
endif()
159161

0 commit comments

Comments
 (0)