diff options
-rw-r--r-- | meson.build | 8 | ||||
-rw-r--r-- | src/android/camera_hal_config.cpp | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/meson.build b/meson.build index 6626fa7e..2e7dffb7 100644 --- a/meson.build +++ b/meson.build @@ -76,6 +76,14 @@ if cc.get_id() == 'gcc' error('gcc version is too old, libcamera requires 7.0 or newer') endif + # On gcc 7 and 8, the file system library is provided in a separate static + # library. + if cc.version().version_compare('<9') + cpp_arguments += [ + '-lstdc++fs', + ] + endif + # gcc 7.1 introduced processor-specific ABI breakages related to parameter # passing on ARM platforms. This generates a large number of messages # during compilation with gcc >=7.1. Silence them. diff --git a/src/android/camera_hal_config.cpp b/src/android/camera_hal_config.cpp index d15df2e3..f33ba269 100644 --- a/src/android/camera_hal_config.cpp +++ b/src/android/camera_hal_config.cpp @@ -6,7 +6,14 @@ */ #include "camera_hal_config.h" +#if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE < 8 +#include <experimental/filesystem> +namespace std { +namespace filesystem = std::experimental::filesystem; +} +#else #include <filesystem> +#endif #include <stdio.h> #include <stdlib.h> #include <string> |