diff --git a/src/coreclr/dlls/mscordbi/CMakeLists.txt b/src/coreclr/dlls/mscordbi/CMakeLists.txt index 0c3666364372a7..c24a90cf70409c 100644 --- a/src/coreclr/dlls/mscordbi/CMakeLists.txt +++ b/src/coreclr/dlls/mscordbi/CMakeLists.txt @@ -2,10 +2,13 @@ # Set the RPATH of mscordbi so that it can find dependencies without needing to set LD_LIBRARY_PATH # For more information: http://www.cmake.org/Wiki/CMake_RPATH_handling. if(CORECLR_SET_RPATH) - set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) if(CLR_CMAKE_HOST_OSX) + set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) + set(CMAKE_INSTALL_NAME_DIR "@rpath") + set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) set(CMAKE_INSTALL_RPATH "@loader_path") else() + set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) set(CMAKE_INSTALL_RPATH "\$ORIGIN") endif(CLR_CMAKE_HOST_OSX) endif(CORECLR_SET_RPATH) diff --git a/src/coreclr/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt b/src/coreclr/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt index 1df233fc68cd80..f9b5f0175caa31 100644 --- a/src/coreclr/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt +++ b/src/coreclr/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt @@ -6,6 +6,8 @@ endif(CLR_CMAKE_HOST_UNIX) # For more information: http://www.cmake.org/Wiki/CMake_RPATH_handling. if(CORECLR_SET_RPATH) if(CLR_CMAKE_HOST_OSX) + set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) + set(CMAKE_INSTALL_NAME_DIR "@rpath") set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) set(CMAKE_INSTALL_RPATH "@loader_path") endif(CLR_CMAKE_HOST_OSX)