From f872b43407ccfb7d17fe7492c7d869b83194f3a6 Mon Sep 17 00:00:00 2001 From: Leonard Lausen Date: Mon, 3 Aug 2020 20:11:06 +0000 Subject: [PATCH] Protobuf_USE_STATIC_LIBS must be set on Apple too (#18851) Fixes https://github.com/apache/incubator-mxnet/issues/18840 --- CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9e2e1886f9a..c6aa06ecc55a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,12 +148,14 @@ else() execute_process(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE SYSTEM_ARCHITECTURE) endif() -if(CMAKE_BUILD_TYPE STREQUAL "Distribution" AND UNIX AND NOT APPLE) - set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) - set(CMAKE_INSTALL_RPATH $\{ORIGIN\}) - # Enforce DT_PATH instead of DT_RUNPATH - set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--disable-new-dtags") - set(CMAKE_EXE_LINKER_FLAGS "-Wl,--disable-new-dtags") +if(CMAKE_BUILD_TYPE STREQUAL "Distribution") + if(UNIX AND NOT APPLE) + set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) + set(CMAKE_INSTALL_RPATH $\{ORIGIN\}) + # Enforce DT_PATH instead of DT_RUNPATH + set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--disable-new-dtags") + set(CMAKE_EXE_LINKER_FLAGS "-Wl,--disable-new-dtags") + endif() set(Protobuf_USE_STATIC_LIBS ON) endif()