workaround absence of <filesystem>

This commit is contained in:
Sébastien Loriot 2024-03-13 17:12:24 +01:00
parent b0ac1d1c19
commit fcbf327b16
1 changed files with 23 additions and 0 deletions

View File

@ -3,6 +3,19 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <iostream>
// work around for old compilers (Apple clang < 11 for example)
#define HAS_FILESYSTEM 1
#if (__has_include)
#if !__has_include(<filesystem>)
#undef HAS_FILESYSTEM
#define HAS_FILESYSTEM 0
#endif
#endif
#if HAS_FILESYSTEM
#include <fstream>
#include <sstream>
#include <filesystem>
@ -80,3 +93,13 @@ int main() {
return 0;
}
#else
int main()
{
std::cout << "Warning: filesystem feature is not present on the system, nothing will be tested\n";
return 0;
}
#endif