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++
|
enable_language(CXX) # C++
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
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
|
# Configurable user settings
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,15 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/** @file */
|
/** @file */
|
||||||
|
#include <ciso646>
|
||||||
|
#ifdef FSEXPERIMENTAL
|
||||||
|
#include <experimental/filesystem>
|
||||||
|
namespace fs = std::experimental::filesystem;
|
||||||
|
#else
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
namespace fs = std::filesystem;
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
@ -715,7 +722,7 @@ class clutchlog
|
||||||
do {
|
do {
|
||||||
outfile = replace(filename_template, tag, n);
|
outfile = replace(filename_template, tag, n);
|
||||||
n++;
|
n++;
|
||||||
} while( std::filesystem::exists( outfile ) );
|
} while( fs::exists( outfile ) );
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Use the parameter as is.
|
// Use the parameter as is.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue