From 005809e0740ed2b5fe47d09a9f29b5a06a5b3e5e Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 29 Aug 2018 17:00:15 +0800 Subject: [PATCH] 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 --- src/common/CMakeLists.txt | 4 ++-- src/test/librbd/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index b82ec2b34aa..fa85ea59850 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 bd54cef1cda..6b6b3b99c89 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 -- 2.39.5