-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'yoe/mut' of https://github.com/YoeDistro/meta-atmel
In C++17, experimental::filesystem can be changed to std::filesystem in some EGT projects. It's madatory for using LLVM/CLang in particular. Signed-off-by: Nicolas Ferre <[email protected]>
- Loading branch information
Showing
4 changed files
with
146 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
recipes-egt/apps/files/0001-launcher-Switch-to-using-std-filesystem.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
From 6a9542ff552689e80aae913d12282ae21c9c5c82 Mon Sep 17 00:00:00 2001 | ||
From: Khem Raj <[email protected]> | ||
Date: Sat, 7 Jan 2023 19:07:28 -0800 | ||
Subject: [PATCH] launcher: Switch to using std::filesystem | ||
|
||
experimental/filesystem is promoted to std::filesystem and is must have | ||
with c++17 and newer standard, some compilers e.g. libcxx with | ||
llvm/clang 15+ has already dropped experimental/filesystem and expect | ||
one to use std::filesystem | ||
|
||
Signed-off-by: Khem Raj <[email protected]> | ||
--- | ||
src/launcher.cpp | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/src/launcher.cpp b/src/launcher.cpp | ||
index 35afa0f..c6d583d 100644 | ||
--- a/src/launcher.cpp | ||
+++ b/src/launcher.cpp | ||
@@ -12,7 +12,7 @@ | ||
#include <cmath> | ||
#include <egt/detail/filesystem.h> | ||
#include <egt/ui> | ||
-#include <experimental/filesystem> | ||
+#include <filesystem> | ||
#include <fstream> | ||
#include <iostream> | ||
#include <memory> | ||
@@ -121,7 +121,7 @@ private: | ||
SwipeCallback m_callback; | ||
}; | ||
|
||
-namespace filesys = std::experimental::filesystem; | ||
+namespace filesys = std::filesystem; | ||
|
||
/* | ||
* Execute a command. | ||
-- | ||
2.39.0 | ||
|
101 changes: 101 additions & 0 deletions
101
...es-graphics/libegt/libegt/0001-Use-std-filesystem-instead-of-std-experimental-files.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
From 7c3c6e07199af92e6d3c2efa0696142b2e493ebb Mon Sep 17 00:00:00 2001 | ||
From: Khem Raj <[email protected]> | ||
Date: Sat, 7 Jan 2023 18:58:21 -0800 | ||
Subject: [PATCH] Use std::filesystem instead of std::experimental::filesystem | ||
|
||
filesystem support is in main runtime for many years now. | ||
Clang 15+ has dropped experimental/filesystem | ||
and now c++17 is asked explicitly so we can be confident of | ||
filesystem support in c++ standard runtime, therefore adjust accordingly | ||
|
||
Signed-off-by: Khem Raj <[email protected]> | ||
--- | ||
examples/dialog/dialog.cpp | 4 ++-- | ||
src/detail/filesystem.cpp | 6 ++---- | ||
src/detail/screen/kmsscreen.cpp | 6 ++---- | ||
src/filedialog.cpp | 4 ++-- | ||
4 files changed, 8 insertions(+), 12 deletions(-) | ||
|
||
diff --git a/examples/dialog/dialog.cpp b/examples/dialog/dialog.cpp | ||
index b0725f67..fafcfad2 100644 | ||
--- a/examples/dialog/dialog.cpp | ||
+++ b/examples/dialog/dialog.cpp | ||
@@ -4,11 +4,11 @@ | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
#include <egt/ui> | ||
-#include <experimental/filesystem> | ||
+#include <filesystem> | ||
#include <memory> | ||
#include <string> | ||
|
||
-namespace fs = std::experimental::filesystem; | ||
+namespace fs = std::filesystem; | ||
|
||
int main(int argc, char** argv) | ||
{ | ||
diff --git a/src/detail/filesystem.cpp b/src/detail/filesystem.cpp | ||
index 5f9e404c..e1fc3c20 100644 | ||
--- a/src/detail/filesystem.cpp | ||
+++ b/src/detail/filesystem.cpp | ||
@@ -11,6 +11,7 @@ | ||
#include "egt/detail/filesystem.h" | ||
#include <climits> | ||
#include <cstring> | ||
+#include <filesystem> | ||
#include <fstream> | ||
#include <iterator> | ||
#include <libgen.h> | ||
@@ -23,10 +24,7 @@ | ||
#include <glob.h> | ||
#endif | ||
|
||
-#ifdef HAVE_EXPERIMENTAL_FILESYSTEM | ||
-#include <experimental/filesystem> | ||
-namespace fs = std::experimental::filesystem; | ||
-#endif | ||
+namespace fs = std::filesystem; | ||
|
||
#ifdef HAVE_WINDOWS_H | ||
#include <cstdio> | ||
diff --git a/src/detail/screen/kmsscreen.cpp b/src/detail/screen/kmsscreen.cpp | ||
index 3958a556..3c2973f2 100644 | ||
--- a/src/detail/screen/kmsscreen.cpp | ||
+++ b/src/detail/screen/kmsscreen.cpp | ||
@@ -29,11 +29,9 @@ | ||
#include <cairo-gfx2d.h> | ||
#endif | ||
|
||
-#ifdef HAVE_EXPERIMENTAL_FILESYSTEM | ||
-#include <experimental/filesystem> | ||
+#include <filesystem> | ||
|
||
-namespace fs = std::experimental::filesystem; | ||
-#endif | ||
+namespace fs = std::filesystem; | ||
|
||
namespace egt | ||
{ | ||
diff --git a/src/filedialog.cpp b/src/filedialog.cpp | ||
index 850bd598..e84bcd80 100644 | ||
--- a/src/filedialog.cpp | ||
+++ b/src/filedialog.cpp | ||
@@ -6,13 +6,13 @@ | ||
#include "detail/egtlog.h" | ||
#include "egt/embed.h" | ||
#include "egt/filedialog.h" | ||
-#include <experimental/filesystem> | ||
+#include <filesystem> | ||
|
||
#ifdef SRCDIR | ||
EGT_EMBED(internal_folder, SRCDIR "/icons/32px/folder.png") | ||
#endif | ||
|
||
-namespace fs = std::experimental::filesystem; | ||
+namespace fs = std::filesystem; | ||
|
||
namespace egt | ||
{ | ||
-- | ||
2.39.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters