Skip to content

Commit

Permalink
RUNPATH only should be set during build (microsoft#854)
Browse files Browse the repository at this point in the history
* RUNPATH only should be set during build

Currently, we set RUNPATH in all our shared objects and executables
at both build time and runtime. Build time is needed because we move
the binaries around to other machines. However, the install time is not
needed.

This is step 1 of 2 in order to move the depthengine into a private
folder instead of in the /lib folder

* Updated comment to explain why its only set during build
  • Loading branch information
Matt Schulte authored Oct 28, 2019
1 parent 1298ae8 commit b946344
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ endif()
# executable for shared objects. This is done on Linux to emulate the default
# behavior of the Windows loader, which searches for DLLs in the path of the
# executable.
#
# We only set RPATH for build since our libs and executables are put in the
# same folder.
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(CMAKE_BUILD_WITH_INSTALL_RPATH YES)
set(CMAKE_INSTALL_RPATH "\$ORIGIN")
set(CMAKE_BUILD_RPATH "\$ORIGIN")
endif()

set(TARGET_ARCH ${CMAKE_SYSTEM_PROCESSOR})
Expand Down

0 comments on commit b946344

Please sign in to comment.