so we don't need to compile boost::filesystem anymore.
Signed-off-by: Kefu Chai <kchai@redhat.com>
# Boost::thread depends on Boost::atomic, so list it explicitly.
set(BOOST_COMPONENTS
- atomic thread system regex random program_options date_time iostreams
- filesystem)
+ atomic thread system regex random program_options date_time iostreams)
set(BOOST_HEADER_COMPONENTS container)
if(WITH_MGR)
admin_socket_output_tests.cc
)
target_link_libraries(ceph_test_admin_socket_output
- ceph-common
- ${Boost_FILESYSTEM_LIBRARY}
- )
+ ceph-common)
+if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
+ target_link_libraries(ceph_test_admin_socket_output
+ -lstdc++fs)
+elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
+ target_link_libraries(ceph_test_admin_socket_output
+ -lc++experimental)
+endif()
install(TARGETS
ceph_test_admin_socket_output
DESTINATION ${CMAKE_INSTALL_BINDIR})
#include <iostream>
#include <regex> // For regex, regex_search
-#include <boost/filesystem/convenience.hpp> // For extension
+#include <experimental/filesystem> // For extension
#include "common/admin_socket_client.h" // For AdminSocketClient
#include "common/ceph_json.h" // For JSONParser, JSONObjIter
bool AdminSocketOutput::init_sockets() {
std::cout << "Initialising sockets" << std::endl;
- for (const auto &x : bfs::directory_iterator(socketdir)) {
+ for (const auto &x : fs::directory_iterator(socketdir)) {
std::cout << x.path() << std::endl;
- if (bfs::extension(x.path()) == ".asok") {
+ if (fs::path(x.path()).extension() == ".asok") {
for (auto &target : targets) {
if (std::regex_search(x.path().filename().string(),
std::regex(prefix + target + R"(\..*\.asok)"))) {
#include <map>
#include <set>
#include <vector>
+#include <experimental/filesystem> // For path
-#include <boost/filesystem/path.hpp> // For path
-#include <boost/filesystem/operations.hpp> // For exists, is_directory
-
-namespace bfs = boost::filesystem;
+namespace fs = std::experimental::filesystem;
using socket_results = std::map<std::string, std::string>;
using test_functions =
std::map<std::string, test_functions> tests;
std::string prefix = "ceph-";
- bfs::path socketdir = "/var/run/ceph";
+ fs::path socketdir = "/var/run/ceph";
};
#endif // CEPH_ADMIN_SOCKET_OUTPUT_H