# snappy
-# absolute path because $snappy_sources used outside of this directory
set(snappy_sources
- ${CMAKE_SOURCE_DIR}/src/compressor/snappy/CompressionPluginSnappy.cc
- $<TARGET_OBJECTS:compressor_objs>
+ CompressionPluginSnappy.cc
)
add_library(ceph_snappy SHARED ${snappy_sources})
add_dependencies(ceph_snappy ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
-target_link_libraries(ceph_snappy ${EXTRALIBS})
-set_target_properties(ceph_snappy PROPERTIES VERSION 2.14.0 SOVERSION 2)
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lsnappy")
+target_link_libraries(ceph_snappy snappy)
+set_target_properties(ceph_snappy PROPERTIES VERSION 2.0.0 SOVERSION 2)
install(TARGETS ceph_snappy DESTINATION lib/compressor)
set(zlib_sources
CompressionPluginZlib.cc
CompressionZlib.cc
- $<TARGET_OBJECTS:compressor_objs>
)
add_library(ceph_zlib SHARED ${zlib_sources})
add_dependencies(ceph_zlib ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
-target_link_libraries(ceph_zlib ${EXTRALIBS})
-set_target_properties(ceph_zlib PROPERTIES VERSION 2.14.0 SOVERSION 2)
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lz")
+target_link_libraries(ceph_zlib z)
+set_target_properties(ceph_zlib PROPERTIES VERSION 2.0.0 SOVERSION 2)
install(TARGETS ceph_zlib DESTINATION lib/compressor)
-add_library(ceph_example SHARED
- compressor_plugin_example.cc
- ${CMAKE_SOURCE_DIR}/src/compressor/Compressor.cc
- )
-target_link_libraries(ceph_example crush pthread ${EXTRA_LIBS})
+add_library(ceph_example SHARED compressor_plugin_example.cc)
# unittest_compression_plugin
add_executable(unittest_compression_plugin EXCLUDE_FROM_ALL
test_compression_plugin.cc
- ${CMAKE_SOURCE_DIR}/src/compressor/Compressor.cc
)
add_ceph_unittest(unittest_compression_plugin ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_compression_plugin)
-target_link_libraries(unittest_compression_plugin
- osd
- common
- global
- dl
- )
+target_link_libraries(unittest_compression_plugin global)
+add_dependencies(unittest_compression_plugin ceph_example)
# unittest_compression_snappy
add_executable(unittest_compression_snappy EXCLUDE_FROM_ALL
test_compression_snappy.cc
- ${snappy_sources}
)
add_ceph_unittest(unittest_compression_snappy ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_compression_snappy)
-target_link_libraries(unittest_compression_snappy
- osd
- common
- global
- dl
- snappy
- )
+target_link_libraries(unittest_compression_snappy global ceph_snappy)
# unittest_compression_plugin_snappy
add_executable(unittest_compression_plugin_snappy EXCLUDE_FROM_ALL
test_compression_plugin_snappy.cc
- ${snappy_sources}
)
add_ceph_unittest(unittest_compression_plugin_snappy ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_compression_plugin_snappy)
-target_link_libraries(unittest_compression_plugin_snappy
- osd
- common
- global
- compressor
- dl
- snappy
- )
+target_link_libraries(unittest_compression_plugin_snappy global)
+add_dependencies(unittest_compression_plugin_snappy ceph_snappy)
# unittest_compression_zlib
add_executable(unittest_compression_zlib EXCLUDE_FROM_ALL
test_compression_zlib.cc
- ${CMAKE_SOURCE_DIR}/src/compressor/zlib/CompressionZlib.cc
)
add_ceph_unittest(unittest_compression_zlib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_compression_zlib)
-target_link_libraries(unittest_compression_zlib
- z
- osd
- common
- global
- )
+target_link_libraries(unittest_compression_zlib global ceph_zlib)
# unittest_compression_plugin_zlib
add_executable(unittest_compression_plugin_zlib EXCLUDE_FROM_ALL
test_compression_plugin_zlib.cc
- ${zlib_sources}
)
add_ceph_unittest(unittest_compression_plugin_zlib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_compression_plugin_zlib)
-target_link_libraries(unittest_compression_plugin_zlib
- osd
- common
- global
- compressor
- dl
- z
- )
-
+target_link_libraries(unittest_compression_plugin_zlib global)
+add_dependencies(unittest_compression_plugin_zlib ceph_zlib)