in case we use pre C++17 C++ compiler and standard library.
this change is not cherry-picked from main, as we are using new C++
stanrdard library which is compliant with C++20. so no need to worry
about this.
Signed-off-by: Tim Serong <tserong@suse.com>
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
if (auto ceph_lib = getenv("CEPH_LIB"); ceph_lib) {
mod_dir = ceph_lib;
} else if (fs::is_regular_file("CMakeCache.txt")) {
- mod_dir = std::filesystem::canonical("lib");
+ mod_dir = fs::canonical("lib");
}
vector<DencoderPlugin> dencoder_plugins;
for (auto& entry : fs::directory_iterator(mod_dir)) {
#include <dlfcn.h>
+#if __has_include(<filesystem>)
#include <filesystem>
+namespace fs = std::filesystem;
+#else
+#include <experimental/filesystem>
+namespace fs = std::experimental::filesystem;
+#endif
#include <vector>
#include "denc_registry.h"
-namespace fs = std::filesystem;
-
class DencoderPlugin {
using dencoders_t = std::vector<std::pair<std::string, Dencoder*>>;
public: