Merge pull request #1 from jacobdenobel/master
Windows and gcc < 9.0 fixes
This commit is contained in:
commit
6123490af6
2 changed files with 17 additions and 3 deletions
|
|
@ -12,7 +12,14 @@ project("clutchlog"
|
|||
enable_language(CXX) # C++
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
set(CMAKE_CXX_STANDARD_LIBRARIES -lstdc++fs)
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -std=c++17 -lstdc++fs")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
|
||||
link_libraries(stdc++fs)
|
||||
add_compile_definitions(FSEXPERIMENTAL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
######################################################################################
|
||||
# Configurable user settings
|
||||
|
|
|
|||
|
|
@ -3,8 +3,15 @@
|
|||
#pragma once
|
||||
|
||||
/** @file */
|
||||
|
||||
#include <ciso646>
|
||||
#ifdef FSEXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
|
|
@ -715,7 +722,7 @@ class clutchlog
|
|||
do {
|
||||
outfile = replace(filename_template, tag, n);
|
||||
n++;
|
||||
} while( std::filesystem::exists( outfile ) );
|
||||
} while( fs::exists( outfile ) );
|
||||
|
||||
} else {
|
||||
// Use the parameter as is.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue