From: Kefu Chai Date: Wed, 29 Aug 2018 09:00:15 +0000 (+0800) Subject: cmake: no need to add "-D" before definitions X-Git-Tag: v14.0.1~457^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F23795%2Fhead;p=ceph.git cmake: no need to add "-D" before definitions and there is no need to make the definition public for the executable target. Signed-off-by: Kefu Chai --- diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index b82ec2b34aa0..fa85ea598509 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -129,8 +129,8 @@ add_library(common-common-objs OBJECT ${common_srcs}) # for options.cc target_compile_definitions(common-common-objs PRIVATE - "-DCEPH_LIBDIR=\"${CMAKE_INSTALL_FULL_LIBDIR}\"" - "-DCEPH_PKGLIBDIR=\"${CMAKE_INSTALL_FULL_PKGLIBDIR}\"") + "CEPH_LIBDIR=\"${CMAKE_INSTALL_FULL_LIBDIR}\"" + "CEPH_PKGLIBDIR=\"${CMAKE_INSTALL_FULL_PKGLIBDIR}\"") set(common_mountcephfs_srcs armor.c diff --git a/src/test/librbd/CMakeLists.txt b/src/test/librbd/CMakeLists.txt index bd54cef1cda4..6b6b3b99c89a 100644 --- a/src/test/librbd/CMakeLists.txt +++ b/src/test/librbd/CMakeLists.txt @@ -90,7 +90,7 @@ set(unittest_librbd_srcs add_executable(unittest_librbd ${unittest_librbd_srcs} $) -target_compile_definitions(unittest_librbd PUBLIC "-DTEST_LIBRBD_INTERNALS") +target_compile_definitions(unittest_librbd PRIVATE "TEST_LIBRBD_INTERNALS") target_link_libraries(unittest_librbd cls_rbd cls_rbd_client @@ -127,7 +127,7 @@ target_link_libraries(ceph_test_librbd librados ${UNITTEST_LIBS} radostest) -target_compile_definitions(ceph_test_librbd PUBLIC "-DTEST_LIBRBD_INTERNALS") +target_compile_definitions(ceph_test_librbd PRIVATE "TEST_LIBRBD_INTERNALS") add_executable(ceph_test_librbd_api test_support.cc