From 104accdc34ef961149696c688be714a00f7d2fd0 Mon Sep 17 00:00:00 2001 From: Aleksei Bavshin Date: Fri, 16 Feb 2024 15:29:32 -0800 Subject: [PATCH] build: drop std::filesystem checks The `` and `-lc++experimental` aren't needed since LLVM 9.0. And since we now require C++20, checking for the `` support shouldn't be necessary either. --- include/factory.hpp | 2 +- include/modules/battery.hpp | 11 ++--------- meson.build | 11 ----------- src/factory.cpp | 2 +- 4 files changed, 4 insertions(+), 22 deletions(-) diff --git a/include/factory.hpp b/include/factory.hpp index 9ce680d7..2eba6c84 100644 --- a/include/factory.hpp +++ b/include/factory.hpp @@ -33,7 +33,7 @@ #include "modules/hyprland/window.hpp" #include "modules/hyprland/workspaces.hpp" #endif -#if defined(__FreeBSD__) || (defined(__linux__) && !defined(NO_FILESYSTEM)) +#if defined(__FreeBSD__) || defined(__linux__) #include "modules/battery.hpp" #endif #if defined(HAVE_CPU_LINUX) || defined(HAVE_CPU_BSD) diff --git a/include/modules/battery.hpp b/include/modules/battery.hpp index bbdd0eed..7955e598 100644 --- a/include/modules/battery.hpp +++ b/include/modules/battery.hpp @@ -1,11 +1,8 @@ #pragma once -#ifdef FILESYSTEM_EXPERIMENTAL -#include -#else -#include -#endif #include + +#include #if defined(__linux__) #include #endif @@ -21,11 +18,7 @@ namespace waybar::modules { -#ifdef FILESYSTEM_EXPERIMENTAL -namespace fs = std::experimental::filesystem; -#else namespace fs = std::filesystem; -#endif class Battery : public ALabel { public: diff --git a/meson.build b/meson.build index d7549731..f2c74947 100644 --- a/meson.build +++ b/meson.build @@ -22,8 +22,6 @@ endif if compiler.has_link_argument('-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') cpp_link_args += ['-lstdc++fs'] endif @@ -44,15 +42,6 @@ else 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 = ''' #include #include diff --git a/src/factory.cpp b/src/factory.cpp index 2ad5b6fa..c39f8ca0 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -16,7 +16,7 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name, auto hash_pos = name.find('#'); auto ref = name.substr(0, hash_pos); 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") { return new waybar::modules::Battery(id, bar_, config_[name]); }