Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10351 from ceph/wip-cmake
cmake changes Reviewed-by: Ali Maredia <amaredia@redhat.com>
- Loading branch information
Showing
16 changed files
with
569 additions
and
557 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
set(libclient_srcs | ||
Client.cc | ||
Dentry.cc | ||
Inode.cc | ||
MetaRequest.cc | ||
ClientSnapRealm.cc | ||
MetaSession.cc | ||
Trace.cc | ||
posix_acl.cc) | ||
add_library(client STATIC ${libclient_srcs}) | ||
target_link_libraries(client osdc mds) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
set(libglobal_srcs | ||
global_init.cc | ||
pidfile.cc | ||
signal_handler.cc) | ||
set(global_common_files | ||
global_context.cc) | ||
add_library(global_common_objs OBJECT ${global_common_files}) | ||
add_library(global STATIC ${libglobal_srcs} | ||
$<TARGET_OBJECTS:global_common_objs>) | ||
target_link_libraries(global common ${CMAKE_THREAD_LIBS_INIT} ${EXTRALIBS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
install(FILES rados/librados.h | ||
rados/rados_types.h | ||
rados/rados_types.hpp | ||
rados/librados.hpp | ||
buffer.h | ||
buffer_fwd.h | ||
memory.h | ||
page.h | ||
crc32c.h | ||
DESTINATION include/rados) | ||
install(FILES | ||
radosstriper/libradosstriper.h | ||
radosstriper/libradosstriper.hpp | ||
DESTINATION include/radosstriper) | ||
|
||
if(WITH_RBD) | ||
install(FILES | ||
rbd/features.h | ||
rbd/librbd.h | ||
rbd/librbd.hpp | ||
DESTINATION include/rbd) | ||
endif() | ||
|
||
if(WITH_RADOSGW) | ||
install(FILES | ||
rados/librgw.h | ||
rados/rgw_file.h | ||
DESTINATION include/rados) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
set(journal_srcs | ||
AsyncOpTracker.cc | ||
Entry.cc | ||
Future.cc | ||
FutureImpl.cc | ||
Journaler.cc | ||
JournalMetadata.cc | ||
JournalPlayer.cc | ||
JournalRecorder.cc | ||
JournalTrimmer.cc | ||
ObjectPlayer.cc | ||
ObjectRecorder.cc | ||
Utils.cc) | ||
add_library(journal STATIC ${journal_srcs}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set(kvs_srcs cls_kvs.cc) | ||
add_library(cls_kvs SHARED ${kvs_srcs}) | ||
set_target_properties(cls_kvs PROPERTIES VERSION "1.0.0" SOVERSION "1") | ||
install(TARGETS cls_kvs DESTINATION ${CMAKE_INSTALL_LIBDIR}/rados-classes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
add_library(librados_objs OBJECT | ||
IoCtxImpl.cc | ||
RadosXattrIter.cc | ||
RadosClient.cc) | ||
add_library(librados ${CEPH_SHARED} | ||
librados.cc | ||
$<TARGET_OBJECTS:librados_objs>) | ||
add_dependencies(librados osdc) | ||
if(WITH_LTTNG) | ||
add_dependencies(librados rados-tp) | ||
endif() | ||
# LINK_PRIVATE instead of PRIVATE is used to backward compatibility with cmake 2.8.11 | ||
target_link_libraries(librados LINK_PRIVATE osdc common cls_lock_client | ||
${BLKID_LIBRARIES} ${CRYPTO_LIBS} ${EXTRALIBS}) | ||
if(ENABLE_SHARED) | ||
set_target_properties(librados PROPERTIES | ||
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") | ||
endif(ENABLE_SHARED) | ||
install(TARGETS librados DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
set(mds_srcs | ||
Capability.cc | ||
MDSDaemon.cc | ||
MDSRank.cc | ||
Beacon.cc | ||
flock.cc | ||
locks.c | ||
journal.cc | ||
Server.cc | ||
Mutation.cc | ||
MDCache.cc | ||
RecoveryQueue.cc | ||
StrayManager.cc | ||
Locker.cc | ||
Migrator.cc | ||
MDBalancer.cc | ||
CDentry.cc | ||
CDir.cc | ||
CInode.cc | ||
LogEvent.cc | ||
MDSTable.cc | ||
InoTable.cc | ||
JournalPointer.cc | ||
MDSTableClient.cc | ||
MDSTableServer.cc | ||
ScrubStack.cc | ||
DamageTable.cc | ||
SimpleLock.cc | ||
SnapRealm.cc | ||
SnapServer.cc | ||
snap.cc | ||
SessionMap.cc | ||
MDSContext.cc | ||
MDSAuthCaps.cc | ||
MDLog.cc | ||
${CMAKE_SOURCE_DIR}/src/common/TrackedOp.cc | ||
${CMAKE_SOURCE_DIR}/src/osdc/Journaler.cc) | ||
add_library(mds STATIC ${mds_srcs} | ||
$<TARGET_OBJECTS:heap_profiler_objs> | ||
$<TARGET_OBJECTS:common_util_obj>) | ||
target_link_libraries(mds ${ALLOC_LIBS} osdc common) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
set(osd_mon_files | ||
Monitor.cc) | ||
add_library(osd_mon_objs OBJECT ${osd_mon_files}) | ||
|
||
set(lib_mon_srcs | ||
${CMAKE_SOURCE_DIR}/src/auth/cephx/CephxKeyServer.cc | ||
${CMAKE_SOURCE_DIR}/src/auth/cephx/CephxServiceHandler.cc | ||
${CMAKE_SOURCE_DIR}/src/auth/AuthServiceHandler.cc | ||
${osd_mon_files} | ||
Paxos.cc | ||
PaxosService.cc | ||
OSDMonitor.cc | ||
MDSMonitor.cc | ||
MonmapMonitor.cc | ||
LogMonitor.cc | ||
AuthMonitor.cc | ||
Elector.cc | ||
HealthMonitor.cc | ||
DataHealthService.cc | ||
PGMonitor.cc | ||
PGMap.cc | ||
ConfigKeyService.cc) | ||
add_library(mon STATIC ${lib_mon_srcs} $<TARGET_OBJECTS:mon_common_objs> | ||
$<TARGET_OBJECTS:kv_objs> $<TARGET_OBJECTS:osd_mon_objs> | ||
$<TARGET_OBJECTS:common_util_obj> $<TARGET_OBJECTS:heap_profiler_objs>) | ||
target_link_libraries(mon ${ALLOC_LIBS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
if(HAVE_LIBXFS) | ||
set(libos_xfs_srcs | ||
filestore/XfsFileStoreBackend.cc | ||
fs/XFS.cc) | ||
endif(HAVE_LIBXFS) | ||
|
||
set(libos_srcs | ||
ObjectStore.cc | ||
Transaction.cc | ||
filestore/chain_xattr.cc | ||
filestore/BtrfsFileStoreBackend.cc | ||
filestore/DBObjectMap.cc | ||
filestore/FileJournal.cc | ||
filestore/FileStore.cc | ||
filestore/JournalThrottle.cc | ||
filestore/GenericFileStoreBackend.cc | ||
filestore/JournalingObjectStore.cc | ||
filestore/HashIndex.cc | ||
filestore/IndexManager.cc | ||
filestore/LFNIndex.cc | ||
filestore/WBThrottle.cc | ||
filestore/ZFSFileStoreBackend.cc | ||
memstore/MemStore.cc | ||
kstore/KStore.cc | ||
kstore/kstore_types.cc | ||
bluestore/kv.cc | ||
bluestore/Allocator.cc | ||
bluestore/BitmapFreelistManager.cc | ||
bluestore/BlockDevice.cc | ||
bluestore/BlueFS.cc | ||
bluestore/bluefs_types.cc | ||
bluestore/BlueRocksEnv.cc | ||
bluestore/BlueStore.cc | ||
bluestore/bluestore_types.cc | ||
bluestore/ExtentFreelistManager.cc | ||
bluestore/FreelistManager.cc | ||
bluestore/KernelDevice.cc | ||
bluestore/StupidAllocator.cc | ||
bluestore/BitMapAllocator.cc | ||
bluestore/BitAllocator.cc | ||
fs/FS.cc | ||
${libos_xfs_srcs}) | ||
|
||
if(HAVE_LIBFUSE) | ||
list(APPEND libos_srcs | ||
FuseStore.cc) | ||
endif() | ||
|
||
if(WITH_SPDK) | ||
list(APPEND libos_srcs | ||
bluestore/NVMEDevice.cc) | ||
endif() | ||
|
||
add_library(os STATIC ${libos_srcs} $<TARGET_OBJECTS:kv_objs>) | ||
|
||
if(HAVE_LIBAIO) | ||
target_link_libraries(os aio) | ||
endif() | ||
|
||
if(HAVE_LIBFUSE) | ||
target_link_libraries(os ${FUSE_LIBRARIES}) | ||
endif() | ||
|
||
if(WITH_SPDK) | ||
target_link_libraries(os | ||
${SPDK_LIBRARIES} | ||
${DPDK_LIBRARIES} | ||
${PCIACCESS_LIBRARIES}) | ||
target_include_directories(os | ||
PRIVATE | ||
${DPDK_INCLUDE_DIR} | ||
${PCIACCESS_INCLUDE_DIR}) | ||
endif(WITH_SPDK) | ||
|
||
if(WITH_LTTNG) | ||
add_dependencies(os os-tp) | ||
endif() | ||
|
||
target_link_libraries(os kv) | ||
|
||
add_dependencies(os compressor_plugins) | ||
|
||
if(HAVE_LIBAIO) | ||
add_executable(ceph-bluefs-tool | ||
bluestore/bluefs_tool.cc) | ||
target_link_libraries(ceph-bluefs-tool | ||
os global) | ||
install(TARGETS ceph-bluefs-tool | ||
DESTINATION bin) | ||
endif() | ||
|
||
if(WITH_SPDK) | ||
add_custom_target(build_spdk | ||
COMMAND | ||
$(MAKE) DPDK_INC_DIR=${DPDK_INCLUDE_DIR} | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/spdk/lib | ||
COMMENT "spdk building") | ||
# TODO: should use add_library(spdk INTERFACE IMPORTED) instead in new cmake, | ||
# if INTERFACE is supported. | ||
foreach(lib nvme memory util) | ||
add_library(spdk_${lib} STATIC IMPORTED) | ||
add_dependencies(spdk_${lib} build_spdk) | ||
set_target_properties(spdk_${lib} PROPERTIES | ||
IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/src/spdk/lib/${lib}/libspdk_${lib}.a" | ||
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/src/spdk/include") | ||
list(APPEND SPDK_LIBRARIES spdk_${lib}) | ||
endforeach() | ||
endif(WITH_SPDK) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
set(osdc_osd_srcs | ||
${CMAKE_SOURCE_DIR}/src/osdc/Objecter.cc | ||
${CMAKE_SOURCE_DIR}/src/osdc/Striper.cc) | ||
|
||
set(osd_srcs | ||
OSD.cc | ||
Watch.cc | ||
ClassHandler.cc | ||
OpRequest.cc | ||
PG.cc | ||
PGLog.cc | ||
ReplicatedPG.cc | ||
ReplicatedBackend.cc | ||
ECBackend.cc | ||
ECTransaction.cc | ||
PGBackend.cc | ||
OSDCap.cc | ||
Watch.cc | ||
ClassHandler.cc | ||
SnapMapper.cc | ||
ScrubStore.cc | ||
osd_types.cc | ||
ECUtil.cc | ||
${CMAKE_SOURCE_DIR}/src/common/TrackedOp.cc | ||
${osdc_osd_srcs}) | ||
if(HAS_VTA) | ||
set_source_files_properties(osdcap.cc | ||
PROPERTIES COMPILE_FLAGS -fno-var-tracking-assignments) | ||
endif() | ||
add_library(osd STATIC ${osd_srcs} | ||
$<TARGET_OBJECTS:osd_mon_objs> | ||
$<TARGET_OBJECTS:cls_references_objs> | ||
$<TARGET_OBJECTS:global_common_objs> | ||
$<TARGET_OBJECTS:heap_profiler_objs> | ||
$<TARGET_OBJECTS:common_util_obj>) | ||
target_link_libraries(osd leveldb ${CMAKE_DL_LIBS} ${ALLOC_LIBS}) | ||
if(WITH_LTTNG) | ||
add_dependencies(osd osd-tp) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
set(osdc_files | ||
Objecter.cc | ||
Filer.cc) | ||
set(osdc_rbd_files | ||
ObjectCacher.cc | ||
Striper.cc) | ||
add_library(osdc_rbd_objs OBJECT ${osdc_rbd_files}) | ||
add_library(osdc STATIC ${osdc_files} $<TARGET_OBJECTS:osdc_rbd_objs>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
add_executable(rbd-fuse | ||
rbd-fuse.cc) | ||
target_link_libraries(rbd-fuse | ||
librbd librados ${FUSE_LIBRARIES}) | ||
install(TARGETS rbd-fuse DESTINATION bin) |
Oops, something went wrong.