blob: a7d8b30ff96053712c42082e6bbcd333de5e69e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
https://github.com/hyprwm/hyprsunset/commit/2626a7f1d03aeb4a2bf2b5b004b7d4677c033b63
Fixes error `no member named 'zoned_time' in namespace 'std::chrono'` on llvm/musl
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -133,6 +133,16 @@ if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
"${CMAKE_SHARED_LINKER_FLAGS} -pg -no-pie -fno-builtin")
endif(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
+include(CheckCXXSourceCompiles)
+check_cxx_source_compiles([[
+ #include <chrono>
+ int main() { std::chrono::zoned_time{}; }
+]] HAVE_STD_ZONED_TIME)
+
+if (NOT HAVE_STD_ZONED_TIME)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexperimental-library")
+endif()
+
if(NOT DEFINED CMAKE_INSTALL_MANDIR)
set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
endif()
--- a/src/Hyprsunset.cpp
+++ b/src/Hyprsunset.cpp
@@ -1,6 +1,7 @@
#include "ConfigManager.hpp"
#include "helpers/Log.hpp"
#include "IPCSocket.hpp"
+#include <algorithm>
#include <cstring>
#include <mutex>
#include <optional>
@@ -8,6 +9,7 @@
#include <chrono>
#include <sys/poll.h>
#include <sys/timerfd.h>
+#include <unistd.h>
#include <wayland-client-core.h>
#define TIMESPEC_NSEC_PER_SEC 1000000000L
|