build: drop std::filesystem checks
The `<experimental/filesystem>` and `-lc++experimental` aren't needed since LLVM 9.0. And since we now require C++20, checking for the `<filesystem>` support shouldn't be necessary either.
This commit is contained in:
parent
3cd311819b
commit
104accdc34
|
@ -33,7 +33,7 @@
|
||||||
#include "modules/hyprland/window.hpp"
|
#include "modules/hyprland/window.hpp"
|
||||||
#include "modules/hyprland/workspaces.hpp"
|
#include "modules/hyprland/workspaces.hpp"
|
||||||
#endif
|
#endif
|
||||||
#if defined(__FreeBSD__) || (defined(__linux__) && !defined(NO_FILESYSTEM))
|
#if defined(__FreeBSD__) || defined(__linux__)
|
||||||
#include "modules/battery.hpp"
|
#include "modules/battery.hpp"
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_CPU_LINUX) || defined(HAVE_CPU_BSD)
|
#if defined(HAVE_CPU_LINUX) || defined(HAVE_CPU_BSD)
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef FILESYSTEM_EXPERIMENTAL
|
|
||||||
#include <experimental/filesystem>
|
|
||||||
#else
|
|
||||||
#include <filesystem>
|
|
||||||
#endif
|
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
#include <sys/inotify.h>
|
#include <sys/inotify.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,11 +18,7 @@
|
||||||
|
|
||||||
namespace waybar::modules {
|
namespace waybar::modules {
|
||||||
|
|
||||||
#ifdef FILESYSTEM_EXPERIMENTAL
|
|
||||||
namespace fs = std::experimental::filesystem;
|
|
||||||
#else
|
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
#endif
|
|
||||||
|
|
||||||
class Battery : public ALabel {
|
class Battery : public ALabel {
|
||||||
public:
|
public:
|
||||||
|
|
11
meson.build
11
meson.build
|
@ -22,8 +22,6 @@ endif
|
||||||
|
|
||||||
if compiler.has_link_argument('-lc++fs')
|
if compiler.has_link_argument('-lc++fs')
|
||||||
cpp_link_args += ['-lc++fs']
|
cpp_link_args += ['-lc++fs']
|
||||||
elif compiler.has_link_argument('-lc++experimental')
|
|
||||||
cpp_link_args += ['-lc++experimental']
|
|
||||||
elif compiler.has_link_argument('-lstdc++fs')
|
elif compiler.has_link_argument('-lstdc++fs')
|
||||||
cpp_link_args += ['-lstdc++fs']
|
cpp_link_args += ['-lstdc++fs']
|
||||||
endif
|
endif
|
||||||
|
@ -44,15 +42,6 @@ else
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if not compiler.has_header('filesystem')
|
|
||||||
if compiler.has_header('experimental/filesystem')
|
|
||||||
add_project_arguments('-DFILESYSTEM_EXPERIMENTAL', language: 'cpp')
|
|
||||||
else
|
|
||||||
add_project_arguments('-DNO_FILESYSTEM', language: 'cpp')
|
|
||||||
warning('No filesystem header found, some modules may not work')
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
code = '''
|
code = '''
|
||||||
#include <langinfo.h>
|
#include <langinfo.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
|
|
@ -16,7 +16,7 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name,
|
||||||
auto hash_pos = name.find('#');
|
auto hash_pos = name.find('#');
|
||||||
auto ref = name.substr(0, hash_pos);
|
auto ref = name.substr(0, hash_pos);
|
||||||
auto id = hash_pos != std::string::npos ? name.substr(hash_pos + 1) : "";
|
auto id = hash_pos != std::string::npos ? name.substr(hash_pos + 1) : "";
|
||||||
#if defined(__FreeBSD__) || (defined(__linux__) && !defined(NO_FILESYSTEM))
|
#if defined(__FreeBSD__) || defined(__linux__)
|
||||||
if (ref == "battery") {
|
if (ref == "battery") {
|
||||||
return new waybar::modules::Battery(id, bar_, config_[name]);
|
return new waybar::modules::Battery(id, bar_, config_[name]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue