]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
cmake: SKIP_RPATH if RPATH is not necessary
authorKefu Chai <kchai@redhat.com>
Fri, 30 Aug 2019 08:21:03 +0000 (16:21 +0800)
committerNathan Cutler <ncutler@suse.com>
Tue, 6 Apr 2021 12:27:30 +0000 (14:27 +0200)
commit80e36d12b90575d9d311be10d7f0f4a2bed6673d
tree983db7b0e02926dda7c28d8e24afb706059581b7
parent829063bca8be5e1e813bb9ef10d8145b5c1d615f
cmake: SKIP_RPATH if RPATH is not necessary

some executables like ceph_test_mon_memory_target do not link against
libraries built from source tree, like librados and libceph-common. so
cmake does not set RPATH for them. hence cmake complains like:

before this change, `CMAKE_INSTALL_RPATH` is set globally. so cmake is
asked to rewrite the RPATH for all installed targets. but this is not
needed. as some executables do not link against libceph-common. hence,
cmake complains when installing them, like:

CMake Error at src/test/mon/cmake_install.cmake:90 (file):
  file RPATH_CHANGE could not write new RPATH:
    /usr/lib64/ceph
   to the file:
    /home/abuild/rpmbuild/BUILDROOT/ceph-15.0.0-4347.g85a07b9.x86_64/usr/bin/ceph_test_log_rss_usage
   No valid ELF RPATH or RUNPATH entry exists in the file;

after this change, `SKIP_RPATH` is set for those executables which do
not link against any libraries created from ceph source tree. so we can
avoid setting the RPATH for these executables when `make install`.

the same applies to libceph-common.

Fixes: https://tracker.ceph.com/issues/41524
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 61708155b4d9d211b7da21aed8ccfe4c8ed3d932)
src/CMakeLists.txt
src/test/mon/CMakeLists.txt