From: Kefu Chai Date: Fri, 13 Oct 2017 05:53:29 +0000 (+0800) Subject: cmake: use CXX_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN X-Git-Tag: v13.0.1~581^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8717eac498c6406500eea8b51e5f5708ce97a2b6;p=ceph-ci.git cmake: use CXX_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN instead of using "-fvisibility=hidden -fvisibility-inlines-hidden", more cmake-ish this way. Signed-off-by: Kefu Chai --- diff --git a/src/librados/CMakeLists.txt b/src/librados/CMakeLists.txt index 634893916f7..07ed54099a3 100644 --- a/src/librados/CMakeLists.txt +++ b/src/librados/CMakeLists.txt @@ -24,10 +24,8 @@ if(ENABLE_SHARED) OUTPUT_NAME rados VERSION 2.0.0 SOVERSION 2 - # use COMPILE_FLAGS for the backward compatibility with cmake 2.8.11, should have been: - # CXX_VISIBILITY_PRESET hidden - # VISIBILITY_INLINES_HIDDEN ON - COMPILE_FLAGS "-fvisibility=hidden -fvisibility-inlines-hidden") + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN ON) if(NOT APPLE) set_property(TARGET librados APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--exclude-libs,ALL") diff --git a/src/librbd/CMakeLists.txt b/src/librbd/CMakeLists.txt index a34f14f3bfc..f6aa8dc9259 100644 --- a/src/librbd/CMakeLists.txt +++ b/src/librbd/CMakeLists.txt @@ -136,7 +136,8 @@ if(ENABLE_SHARED) OUTPUT_NAME rbd VERSION 1.12.0 SOVERSION 1 - COMPILE_FLAGS "-fvisibility=hidden -fvisibility-inlines-hidden") + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN ON) if(NOT APPLE) set_property(TARGET librbd APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--exclude-libs,ALL")