Skip to content

Commit

Permalink
Enabled C++ 17 and std::filesystem on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
hsm4 committed Jan 22, 2024
1 parent fabfbc5 commit 3ea67f4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

cmake_minimum_required(VERSION 3.15 FATAL_ERROR)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if (APPLE)
Expand Down
2 changes: 1 addition & 1 deletion cmake/CompileOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ set(CMAKE_BUILD_PARALLEL_LEVEL 16)
set(DEFAULT_PROJECT_OPTIONS
DEBUG_POSTFIX "-debug"
RELEASE_POSTFIX "-release"
CXX_STANDARD 14
CXX_STANDARD 17
LINKER_LANGUAGE "CXX"
POSITION_INDEPENDENT_CODE ON
CXX_VISIBILITY_PRESET "hidden"
Expand Down
10 changes: 7 additions & 3 deletions modules/utils/source/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@ namespace fs = std::experimental::filesystem;
#elif defined(__APPLE__)
# if defined(TARGET_OS_IOS) && (TARGET_OS_IOS == 1)
# include "Utils_iOS.h"
# include <dirent.h> //dirent
# include <sys/stat.h> //dirent
# include <unistd.h> //getcwd
# else
# include <filesystem>
# define USE_STD_FILESYSTEM
namespace fs = std::filesystem;
# endif
# include <dirent.h>
# include <sys/stat.h> //dirent
# include <unistd.h> //getcwd
#elif defined(ANDROID) || defined(ANDROID_NDK)
# include <android/log.h>
# include <dirent.h>
Expand Down

0 comments on commit 3ea67f4

Please sign in to comment.