In GCC-7 filesystem is in std::experimental.
This commit is contained in:
parent
a9d3ab7aeb
commit
b4c4393cd8
|
@ -3,7 +3,9 @@ include(GNUInstallDirs)
|
|||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(cgicc REQUIRED IMPORTED_TARGET cgicc)
|
||||
find_package(nlohmann_json REQUIRED CONFIG)
|
||||
find_package(Filesystem REQUIRED)
|
||||
find_package(Filesystem REQUIRED COMPONENTS Final Experimental)
|
||||
|
||||
configure_file(fs-compat.hpp.in fs-compat.hpp @ONLY)
|
||||
|
||||
add_executable(${PROJECT_NAME} main.cpp)
|
||||
|
||||
|
@ -14,6 +16,9 @@ target_sources(${PROJECT_NAME}
|
|||
unset(sources_src)
|
||||
unset(headers_src)
|
||||
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
PRIVATE PkgConfig::cgicc nlohmann_json std::filesystem)
|
||||
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
*/
|
||||
|
||||
#include "cgi.hpp"
|
||||
#include "fs-compat.hpp"
|
||||
|
||||
#include <cgicc/Cgicc.h>
|
||||
|
||||
#include <exception>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <ios>
|
||||
#include <iostream>
|
||||
|
@ -42,8 +42,6 @@ using std::string_view;
|
|||
using std::stringstream;
|
||||
using std::vector;
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
entry_type parse_formdata()
|
||||
{
|
||||
entry_type entry;
|
||||
|
|
2
src/fs-compat.hpp.in
Normal file
2
src/fs-compat.hpp.in
Normal file
|
@ -0,0 +1,2 @@
|
|||
#include <@CXX_FILESYSTEM_HEADER@>
|
||||
namespace fs = @CXX_FILESYSTEM_NAMESPACE@;
|
|
@ -15,14 +15,13 @@
|
|||
*/
|
||||
|
||||
#include "cgi.hpp"
|
||||
#include "fs-compat.hpp"
|
||||
#include "json.hpp"
|
||||
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
|
||||
using std::cout;
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
using namespace FediBlock;
|
||||
|
||||
void print_debug(const entry_type &entry)
|
||||
|
|
Reference in New Issue
Block a user