Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbreak build with libc++ #73

Merged
merged 1 commit into from
Feb 23, 2024
Merged

Unbreak build with libc++ #73

merged 1 commit into from
Feb 23, 2024

Conversation

jbeich
Copy link
Contributor

@jbeich jbeich commented Feb 23, 2024

Fixes #70. Tested with Clang/libc++ 17

  • libc++ 18 has atomic floats but libc++ < 18 may still be common on distros
  • libc++ 19 has tzdb and soon will have current_zone

src/renderer/AsyncResourceGatherer.cpp:98:22: error: no viable overloaded '+='
   98 |             progress += 1.0 / (preloads + 1.0);
      |             ~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~
src/renderer/widgets/IWidget.cpp:41:44: error: no member named 'current_zone' in namespace 'std::chrono'
   41 |     const auto current_zone = std::chrono::current_zone();
      |                               ~~~~~~~~~~~~~^
@Matthieu-Sauer Matthieu-Sauer mentioned this pull request Feb 23, 2024
@MrDuartePT
Copy link
Contributor

MrDuartePT commented Feb 23, 2024

I will try llvm 18 sortly with and without this PR. Would be good to add your patch in the guru ebuild.

(My gentoo machine is still compiling the llvm stack)

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@vaxerski vaxerski merged commit 8969351 into hyprwm:main Feb 23, 2024
1 check passed
@MrDuartePT
Copy link
Contributor

MrDuartePT commented Feb 23, 2024

You merge it after doing the test on my machine :). Seems to compile just fine, just need to check if all feature work well and then I can close my issue as well

@MrDuartePT
Copy link
Contributor

MrDuartePT commented Feb 23, 2024

Ok scratch what I said above I still have gcc set and dint notice.
@jbeich what CXXFLAG you use to compile hyprlock since it failing on my end.

/usr/lib/llvm/17/bin/clang++-17  -I/var/tmp/portage/gui-apps/hyprlock-9999/work/hyprlock-9999/. -I/var/tmp/portage/gui-apps/hyprlock-9999/work/hyprlock-9999/protocols -isystem /usr/include/pango-1.0 -isystem /usr/include/cairo -isystem /usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include -isystem /usr/include/harfbuzz -isystem /usr/include/freetype2 -isystem /usr/include/libdrm -isystem /usr/include/libpng16 -isystem /usr/include/pixman-1 -isystem /usr/lib64/libffi/include -isystem /usr/include/libmount -isystem /usr/include/uuid -isystem /usr/include/json-c -isystem /usr/include/blkid -isystem /usr/include/fribidi  -stdlib=libc++ -march=native -O3 -pipe -fdiagnostics-color=always -flto=thin -std=gnu++23 -Wall -Wextra -Wno-unused-parameter -Wno-unused-value -Wno-missing-field-initializers -Wno-narrowing -pthread -MD -MT CMakeFiles/hyprlock.dir/src/config/ConfigManager.cpp.o -MF CMakeFiles/hyprlock.dir/src/config/ConfigManager.cpp.o.d -o CMakeFiles/hyprlock.dir/src/config/ConfigManager.cpp.o -c /var/tmp/portage/gui-apps/hyprlock-9999/work/hyprlock-9999/src/config/ConfigManager.cpp
/var/tmp/portage/gui-apps/hyprlock-9999/work/hyprlock-9999/src/config/ConfigManager.cpp:91:6: error: no type named 'mutex' in namespace 'std'
   91 | std::mutex   configMtx;
      | ~~~~~^
/var/tmp/portage/gui-apps/hyprlock-9999/work/hyprlock-9999/src/config/ConfigManager.cpp:94:10: error: no member named 'lock_guard' in namespace 'std'
   94 |     std::lock_guard<std::mutex> lg(configMtx);
      |     ~~~~~^
/var/tmp/portage/gui-apps/hyprlock-9999/work/hyprlock-9999/src/config/ConfigManager.cpp:94:26: error: no member named 'mutex' in namespace 'std'
   94 |     std::lock_guard<std::mutex> lg(configMtx);
      |                     ~~~~~^
3 errors generated.

My CXXFLAGS:

COMMON_FLAGS="-march=native -O3 -pipe -fdiagnostics-color=always -flto=thin"
CXXFLAGS="-stdlib=libc++ ${COMMON_FLAGS}"

@MrDuartePT
Copy link
Contributor

MrDuartePT commented Feb 23, 2024

Ok I found the fix one file require:
#include <mutex>
I gonna open a PR
Not seems to be needed for gcc

MrDuartePT added a commit to MrDuartePT/hyprlock that referenced this pull request Feb 23, 2024
src/config/ConfigManager.cpp:91:6: error: no type named 'mutex' in namespace 'std'
   91 | std::mutex   configMtx;
      | ~~~~~^
src/config/ConfigManager.cpp:94:10: error: no member named 'lock_guard' in namespace 'std'
   94 |     std::lock_guard<std::mutex> lg(configMtx);
      |     ~~~~~^
/var/tmp/portage/gui-apps/hyprlock-9999/work/hyprlock-9999/src/config/ConfigManager.cpp:94:26: error: no member named 'mutex' in namespace 'std'
   94 |     std::lock_guard<std::mutex> lg(configMtx);
      |                     ~~~~~^

Complete what is missing in hyprwm#73

Signed-off-by: Gonçalo Negrier Duarte <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fails to build with libc++
3 participants