]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: define FMT_HEADER_ONLY using CMakeLists.txt
authorKefu Chai <tchaikov@gmail.com>
Thu, 8 Dec 2022 04:38:07 +0000 (12:38 +0800)
committerKefu Chai <tchaikov@gmail.com>
Sat, 10 Dec 2022 01:58:04 +0000 (09:58 +0800)
less repeatings this way. and the macro definition can be populated
to the targets linking against `rgw_common`. this is more maintainable,
as rgw executables and libraries always link against `rgw_common`.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
13 files changed:
src/rgw/CMakeLists.txt
src/rgw/driver/dbstore/common/dbstore.h
src/rgw/driver/dbstore/config/sqlite.cc
src/rgw/driver/dbstore/config/store.cc
src/rgw/driver/dbstore/sqlite/connection.h
src/rgw/driver/rados/cls_fifo_legacy.cc
src/rgw/driver/rados/cls_fifo_legacy.h
src/rgw/driver/rados/rgw_data_sync.h
src/rgw/driver/rados/rgw_datalog.h
src/rgw/driver/rados/rgw_log_backing.h
src/rgw/rgw_admin.cc
src/rgw/rgw_common.h
src/rgw/rgw_lc.cc

index e082de9d09a895bf821e236ff3f2354801040946..2fe0de6c6e5f96b9265da59bd439e3fd0a0a3257 100644 (file)
@@ -215,6 +215,8 @@ if(WITH_JAEGER)
 endif()
 
 add_library(rgw_common STATIC ${librgw_common_srcs})
+target_compile_definitions(rgw_common
+  PUBLIC "FMT_HEADER_ONLY")
 
 include(CheckCXXCompilerFlag)
 check_cxx_compiler_flag("-Wimplicit-const-int-float-conversion"
index 12ab3f0600ddda03c2c4ba00f54011e6c4585735..70dbd851544edd318ca055000b2bbf95dbdea580 100644 (file)
 #include <iostream>
 #include <mutex>
 #include <condition_variable>
-// this seems safe to use, at least for now--arguably, we should
-// prefer header-only fmt, in general
-#undef FMT_HEADER_ONLY
-#define FMT_HEADER_ONLY 1
 #include "fmt/format.h"
 #include <map>
 #include "rgw_sal_store.h"
index 051dc34e92192d9bc144cab8b09efda30d94e08e..a1b217735561f15dfaac640f3d6fd313672fe0dc 100644 (file)
@@ -17,8 +17,6 @@
 #include <initializer_list>
 #include <map>
 
-#undef FMT_HEADER_ONLY
-#define FMT_HEADER_ONLY 1
 #include <fmt/format.h>
 
 #include <sqlite3.h>
index 66f7471d53416565799733f5a3b3598d9a8334fb..569a093b7d71ea8d432ee046d1fb61aa4045063f 100644 (file)
@@ -15,8 +15,6 @@
 
 #include <stdexcept>
 
-#undef FMT_HEADER_ONLY
-#define FMT_HEADER_ONLY 1
 #include <fmt/format.h>
 
 #include "store.h"
index f5cd77d6e2600b557c4983b487015fb517b6f640..6088763fd0d716ddba595d71f0251efba94070a7 100644 (file)
@@ -18,8 +18,6 @@
 #include <memory>
 #include <sqlite3.h>
 
-#undef FMT_HEADER_ONLY
-#define FMT_HEADER_ONLY 1
 #include <fmt/format.h>
 
 #include "sqlite/statement.h"
index 23b39b9fa5f0da36bf771f0bf333e0353b8fe68e..5b83c850cafe6f830a716e765503222011b8dbe9 100644 (file)
@@ -18,8 +18,6 @@
 #include <optional>
 #include <string_view>
 
-#undef FMT_HEADER_ONLY
-#define FMT_HEADER_ONLY 1
 #include <fmt/format.h>
 
 #include "include/rados/librados.hpp"
index 9a35e4dd251ce4024bda6ad1212a8acae0cb688c..02ad25bc6a9e5e39f0be0872812b898b1eee0949 100644 (file)
@@ -25,8 +25,6 @@
 #include <string_view>
 #include <vector>
 
-#undef FMT_HEADER_ONLY
-#define FMT_HEADER_ONLY 1
 #include <fmt/format.h>
 
 #include "include/rados/librados.hpp"
index ccd56fa6a19738369e52c12e9eb71d8ed9b0c29d..6f05d157c9a4c9432c488c609a9f9e6323035c26 100644 (file)
@@ -4,8 +4,6 @@
 #ifndef CEPH_RGW_DATA_SYNC_H
 #define CEPH_RGW_DATA_SYNC_H
 
-#undef FMT_HEADER_ONLY
-#define FMT_HEADER_ONLY 1
 #include <fmt/format.h>
 #include <fmt/ostream.h>
 
index 0bc4837c9c1bfb43920a94e38e0629f3932a56f6..695485bf2e41cb3eb785f0a46571c82226309070 100644 (file)
@@ -17,8 +17,6 @@
 #include <boost/smart_ptr/intrusive_ptr.hpp>
 #include <boost/smart_ptr/intrusive_ref_counter.hpp>
 
-#undef FMT_HEADER_ONLY
-#define FMT_HEADER_ONLY 1
 #include <fmt/format.h>
 
 #include "include/buffer.h"
index 3fa67d7418bb796d01b2d15a2d1e60a66ec42ec6..a431574c46fa89233fad73d4e4fba227dcddecd1 100644 (file)
@@ -14,8 +14,6 @@
 #include <boost/container/flat_map.hpp>
 #include <boost/system/error_code.hpp>
 
-#undef FMT_HEADER_ONLY
-#define FMT_HEADER_ONLY 1
 #include <fmt/format.h>
 
 #include "include/rados/librados.hpp"
index f18ce8cfbfb78f9b4b25f3c04dcd8d77e9c9a729..4ce018f330fe7d3420df960d080fbbcc2c5abe71 100644 (file)
@@ -12,8 +12,6 @@ extern "C" {
 #include <liboath/oath.h>
 }
 
-#undef FMT_HEADER_ONLY
-#define FMT_HEADER_ONLY 1
 #include <fmt/format.h>
 
 #include "auth/Crypto.h"
index a0af2179ee5b6ac19b48c63dc2a40075711dc699..260519fdba02130f4529319df41c00bc6534fac3 100644 (file)
@@ -21,8 +21,6 @@
 #include <atomic>
 #include <unordered_map>
 
-#undef FMT_HEADER_ONLY
-#define FMT_HEADER_ONLY 1
 #include <fmt/format.h>
 
 #include "common/ceph_crypto.h"
index 0ef047ea93fd933b5cb2137df6a48b631d0fe6e7..4947d410afa460d875742f698407e589499e07d0 100644 (file)
 #include "rgw_lc_tier.h"
 #include "rgw_notify.h"
 
-// this seems safe to use, at least for now--arguably, we should
-// prefer header-only fmt, in general
-#undef FMT_HEADER_ONLY
-#define FMT_HEADER_ONLY 1
 #include "fmt/format.h"
 
 #include "services/svc_sys_obj.h"