to silence warning like:
unknown warning group '-Wimplicit-const-int-float-conversion', ignored [-Werror,-Wunknown-warning-option]
#pragma clang diagnostic ignored "-Wimplicit-const-int-float-conversion"
clang-10 does not support this option yet.
Signed-off-by: Kefu Chai <kchai@redhat.com>
endif()
add_library(rgw_common STATIC ${librgw_common_srcs})
+
+include(CheckCXXCompilerFlag)
+check_cxx_compiler_flag("-Wimplicit-const-int-float-conversion"
+ COMPILER_SUPPORTS_WARN_IMPLICIT_CONST_INT_FLOAT_CONVERSION)
+if(COMPILER_SUPPORTS_WARN_IMPLICIT_CONST_INT_FLOAT_CONVERSION)
+ target_compile_definitions(common-objs PRIVATE
+ HAVE_WARN_IMPLICIT_CONST_INT_FLOAT_CONVERSION)
+endif()
+
target_link_libraries(rgw_common
PRIVATE
ceph-common
#include <boost/algorithm/string/replace.hpp>
#include <boost/tokenizer.hpp>
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
+#ifdef HAVE_WARN_IMPLICIT_CONST_INT_FLOAT_CONVERSION
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wimplicit-const-int-float-conversion"
+#endif
#include <s3select/include/s3select.h>
+#ifdef HAVE_WARN_IMPLICIT_CONST_INT_FLOAT_CONVERSION
#pragma clang diagnostic pop
+#endif
#undef BOOST_BIND_GLOBAL_PLACEHOLDERS
#include <liboath/oath.h>