Let's add the 'rpath' in order to fix error happened while
'paltest_pal_sxs_test1' (ELF) of PAL test is loading a shared library.
This 'rpath' statement is derived from the existing files such as
./ToolBox/SOS/Strike/CMakeLists.txt and dlls/mscordbi/CMakeLists.txt.
Ver2:
Apply 'rpath' in case of the Linux platform only
Ver1:
Let's add 'rpath' statement to the Linux platform environment
that we have experienced issue.
Signed-off-by: Geunsik Lim <geunsik.lim@samsung.com>
CC: Mike McLaughlin <mikem@microsoft.com>
add_definitions(-DFEATURE_ENABLE_HARDWARE_EXCEPTIONS)
endif(CLR_CMAKE_PLATFORM_UNIX)
+# Set the RPATH of paltest_pal_sxs_test1 so that it can find dependencies without needing to set LD_LIBRARY
+# For more information: http://www.cmake.org/Wiki/CMake_RPATH_handling.
+if(CORECLR_SET_RPATH)
+ if(CLR_CMAKE_PLATFORM_LINUX)
+ set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+ set(CMAKE_INSTALL_RPATH "\$ORIGIN")
+ endif(CLR_CMAKE_PLATFORM_LINUX)
+endif(CORECLR_SET_RPATH)
+
# Test DLL1
set(DEF_SOURCES1 dlltest1.src)