hyprwm / xdg-desktop-portal-hyprland

xdg-desktop-portal backend for Hyprland
BSD 3-Clause "New" or "Revised" License
307 stars 48 forks source link

[CMake] Fails to build with Clang #156

Closed jbeich closed 10 months ago

jbeich commented 10 months ago

f9461b0b7d30 forgot to add -Wno-address-of-temporary to CMakeLists.txt.

src/shared/ScreencopyShared.cpp:247:69: error: taking the address of a temporary object of type 'struct spa_rectangle' [-Waddress-of-temporary]
    spa_pod_builder_add(b, SPA_FORMAT_VIDEO_size, SPA_POD_Rectangle(&SPA_RECTANGLE(width, height)), 0);
                                                  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/spa-0.2/spa/pod/vararg.h:66:39: note: expanded from macro 'SPA_POD_Rectangle'
#define SPA_POD_Rectangle(val)                          "R",val
                                                            ^~~
fufexan commented 10 months ago

Oops, I removed that in #154 due to this:

note: unrecognized command-line option '-Wno-address-of-temporary' may have been intended to silence earlier diagnostics

I will add it back.

fufexan commented 10 months ago

Added in https://github.com/hyprwm/xdg-desktop-portal-hyprland/commit/c0b606460a099efdea48347aeb40b01af3d9af1c.

jbeich commented 10 months ago

I confirm, builds fine now.