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 + 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 #include #include #include @@ -8,6 +9,7 @@ #include #include #include +#include #include #define TIMESPEC_NSEC_PER_SEC 1000000000L