summaryrefslogtreecommitdiff
path: root/patches/zano/0004-use-boost-filesystem-instead-of-stdfs.patch
blob: 38862a2c10fe61b7dd55f1d11ebc86faa4f69d80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From 5a5c7a4d565ed9679bf960a08e894fcaff9ce73b Mon Sep 17 00:00:00 2001
From: Czarek Nakamoto <cyjan@mrcyjanek.net>
Date: Wed, 4 Dec 2024 17:21:44 -0600
Subject: [PATCH 4/7] use boost::filesystem instead of stdfs

---
 CMakeLists.txt                       | 19 ++-----------------
 contrib/epee/include/file_io_utils.h |  6 +++---
 2 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index aa2687fd..7694b8eb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -234,22 +234,7 @@ if(STATIC)
 endif()
 
 message("CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")    
-if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
-  set(CMAKE_OSX_DEPLOYMENT_TARGET 12.00)
-  if(NOT DEFINED SKIP_BOOST_FATLIB_LIB OR NOT SKIP_BOOST_FATLIB_LIB)
-	message("Ios: libboost.a included as library")    
-	set(Boost_LIBRARIES "libboost.a")
-  else()
-	message("Ios: libboost.a not included as library")    
-  endif()
-  #workaround for new XCode 12 policy for builds(now it includes a slice for the "arm64" when builds for simulator)
-  set(__iphoneos_archs "arm64")
-  #set(__iphonesimulator_archs "arm64,x86_64")
-  set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "${__iphoneos_archs}")
-  set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "${__iphoneos_archs}")
-  #set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "${__iphonesimulator_archs}")
-  #set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "${__iphonesimulator_archs}")
-elseif(CMAKE_SYSTEM_NAME STREQUAL "Android")
+if(CMAKE_SYSTEM_NAME STREQUAL "Android")
   if(CAKEWALLET)
     find_package(Boost ${ZANO_BOOST_MIN_VER} REQUIRED COMPONENTS system filesystem locale thread timer date_time chrono regex serialization atomic program_options)
   else()
@@ -306,7 +291,7 @@ else()
   find_package(Git QUIET)
   if(Git_FOUND OR GIT_FOUND)
     message(STATUS "Found Git: ${GIT_EXECUTABLE}")
-    add_custom_target(version ALL "${CMAKE_COMMAND}" "-D" "VERSION=${VERSION}" "-D" "GIT=${GIT_EXECUTABLE}" "-D" "TO=${CMAKE_BINARY_DIR}/version/version.h" "-P" "src/version.cmake" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
+    add_custom_target(version ALL "${CMAKE_COMMAND}" "-D" "VERSION=${VERSION}" "-D" "GIT=${GIT_EXECUTABLE}" "-D" "TO=${CMAKE_BINARY_DIR}/version/version.h" "-P" "src/version.cmake" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
   else()
     message(STATUS "WARNING: Git was not found!")
     set(VERSION "${VERSION}-unknown")
diff --git a/contrib/epee/include/file_io_utils.h b/contrib/epee/include/file_io_utils.h
index bb21ae99..ced01092 100644
--- a/contrib/epee/include/file_io_utils.h
+++ b/contrib/epee/include/file_io_utils.h
@@ -574,10 +574,10 @@ namespace file_io_utils
 		try
 		{
 
-			stdfs::directory_iterator end_itr; // default construction yields past-the-end
-			for (stdfs::directory_iterator itr( epee::string_encoding::utf8_to_wstring(path) ); itr != end_itr; ++itr )
+			boost::filesystem::directory_iterator end_itr; // default construction yields past-the-end
+			for ( boost::filesystem::directory_iterator itr( epee::string_encoding::utf8_to_wstring(path) ); itr != end_itr; ++itr )
 			{
-				if ( only_files && stdfs::is_directory(itr->status()) )
+				if ( only_files && boost::filesystem::is_directory(itr->status()) )
 				{
 					continue;
 				}
-- 
2.51.0