[Bf-blender-cvs] [c0c605df347] temp-asset-browser-catalogs: Use `ghc::filesystem` as platform compatible replacement for `std::filesystem`

Julian Eisel noreply at git.blender.org
Tue Aug 31 16:57:22 CEST 2021


Commit: c0c605df347332a9377d6f3224bce94e8f186032
Author: Julian Eisel
Date:   Tue Aug 31 16:55:03 2021 +0200
Branches: temp-asset-browser-catalogs
https://developer.blender.org/rBc0c605df347332a9377d6f3224bce94e8f186032

Use `ghc::filesystem` as platform compatible replacement for `std::filesystem`

Previous commit merged the `temp-cpp-ghc-filesystem` branch into this, now we
can actually use this replacment. This way the branch can be compiled on macOS.

===================================================================

M	source/blender/blenkernel/BKE_asset_catalog.hh
M	source/blender/blenkernel/BKE_asset_library.hh
M	source/blender/blenkernel/CMakeLists.txt
M	source/blender/blenkernel/intern/asset_catalog.cc
M	source/blender/blenkernel/intern/asset_catalog_test.cc

===================================================================

diff --git a/source/blender/blenkernel/BKE_asset_catalog.hh b/source/blender/blenkernel/BKE_asset_catalog.hh
index 91ad5264a3c..b4eee4cfc38 100644
--- a/source/blender/blenkernel/BKE_asset_catalog.hh
+++ b/source/blender/blenkernel/BKE_asset_catalog.hh
@@ -24,6 +24,7 @@
 #  error This is a C++ header. The C interface is yet to be implemented/designed.
 #endif
 
+#include "BLI_filesystem.hh"
 #include "BLI_map.hh"
 #include "BLI_set.hh"
 #include "BLI_string_ref.hh"
@@ -37,7 +38,7 @@ namespace blender::bke {
 
 using CatalogID = std::string;
 using CatalogPath = std::string;
-using CatalogFilePath = std::filesystem::path;
+using CatalogFilePath = filesystem::path;
 
 class AssetCatalog;
 class AssetCatalogDefinitionFile;
diff --git a/source/blender/blenkernel/BKE_asset_library.hh b/source/blender/blenkernel/BKE_asset_library.hh
index 1228de9a974..d12130ca368 100644
--- a/source/blender/blenkernel/BKE_asset_library.hh
+++ b/source/blender/blenkernel/BKE_asset_library.hh
@@ -34,7 +34,7 @@
 namespace blender::bke {
 
 /* TODO(@sybren): revisit after D12117 has a conclusion. */
-namespace fs = std::filesystem;
+namespace fs = blender::filesystem;
 
 struct AssetLibrary {
   std::unique_ptr<AssetCatalogService> catalog_service;
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 51140463eba..3afa07b1547 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -53,6 +53,7 @@ set(INC
   ../../../intern/mikktspace
   ../../../intern/opensubdiv
   ../../../extern/curve_fit_nd
+  ../../../extern/ghc_filesystem
 
   # dna_type_offsets.h
   ${CMAKE_CURRENT_BINARY_DIR}/../makesdna/intern
diff --git a/source/blender/blenkernel/intern/asset_catalog.cc b/source/blender/blenkernel/intern/asset_catalog.cc
index c5cfcef8cdd..f9574908ed4 100644
--- a/source/blender/blenkernel/intern/asset_catalog.cc
+++ b/source/blender/blenkernel/intern/asset_catalog.cc
@@ -20,12 +20,13 @@
 
 #include "BKE_asset_catalog.hh"
 
+#include "BLI_filesystem.hh"
 #include "BLI_string_ref.hh"
 
 #include <filesystem>
 #include <fstream>
 
-namespace fs = std::filesystem;
+namespace fs = blender::filesystem;
 
 namespace blender::bke {
 
diff --git a/source/blender/blenkernel/intern/asset_catalog_test.cc b/source/blender/blenkernel/intern/asset_catalog_test.cc
index da6bc674f6f..856008e0537 100644
--- a/source/blender/blenkernel/intern/asset_catalog_test.cc
+++ b/source/blender/blenkernel/intern/asset_catalog_test.cc
@@ -26,7 +26,7 @@
 
 #include <filesystem>
 
-namespace fs = std::filesystem;
+namespace fs = blender::filesystem;
 
 namespace blender::bke::tests {



More information about the Bf-blender-cvs mailing list