]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cmake: SKIP_RPATH if RPATH is not necessary 30028/head
authorKefu Chai <kchai@redhat.com>
Fri, 30 Aug 2019 08:21:03 +0000 (16:21 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 3 Sep 2019 02:27:18 +0000 (10:27 +0800)
commit61708155b4d9d211b7da21aed8ccfe4c8ed3d932
treed520e19f4dbde7b293a388c9ab5bbb38da8faa06
parent45bab2cb1cf667c2c5c82a78a141fa5883dbd0e3
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>
src/CMakeLists.txt
src/test/mon/CMakeLists.txt