build: Unbreak build on FreeBSD (#98)

* helpers: add missing header after 9dfb9e125b

src/helpers/MiscFunctions.cpp: In function 'void addHyprlandNotification(const std::string&, float, const std::string&, const std::string&)':
src/helpers/MiscFunctions.cpp:24:9: error: 'fork' was not declared in this scope
   24 |     if (fork() == 0)
      |         ^~~~
src/helpers/MiscFunctions.cpp:25:9: error: 'execl' was not declared in this scope
   25 |         execl("/bin/sh", "/bin/sh", "-c", CMD.c_str(), nullptr);
      |         ^~~~~

* build: add missing dependency for libc++ after 2f48e65503

ld.lld: error: undefined symbol: pthread_create
>>> referenced by PortalManager.cpp
>>>               src/xdg-desktop-portal-hyprland.p/core_PortalManager.cpp.o:(CPortalManager::startEventLoop())
>>> referenced by PortalManager.cpp
>>>               src/xdg-desktop-portal-hyprland.p/core_PortalManager.cpp.o:(CPortalManager::startEventLoop())
This commit is contained in:
Jan Beich 2023-09-18 19:00:21 +00:00 committed by GitHub
parent ccdb6a4899
commit 54b5467ec1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View file

@ -31,12 +31,14 @@ message(STATUS "Checking deps...")
add_subdirectory(subprojects/sdbus-cpp)
add_subdirectory(hyprland-share-picker)
find_package(Threads REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(deps REQUIRED IMPORTED_TARGET wayland-client wayland-protocols libpipewire-0.3 libspa-0.2 libdrm gbm)
file(GLOB_RECURSE SRCFILES CONFIGURE_DEPENDS "src/*.cpp")
add_executable(xdg-desktop-portal-hyprland ${SRCFILES})
target_link_libraries(xdg-desktop-portal-hyprland PRIVATE rt sdbus-c++ PkgConfig::deps)
target_link_libraries(xdg-desktop-portal-hyprland PRIVATE rt sdbus-c++ Threads::Threads PkgConfig::deps)
# protocols
find_program(WaylandScanner NAMES wayland-scanner)

View file

@ -1,5 +1,6 @@
#include "MiscFunctions.hpp"
#include <memory>
#include <unistd.h>
#include "../helpers/Log.hpp"
std::string execAndGet(const char* cmd) {

View file

@ -8,6 +8,7 @@ executable('xdg-desktop-portal-hyprland',
dependency('libdrm'),
dependency('libpipewire-0.3'),
dependency('sdbus-c++'),
dependency('threads'),
dependency('wayland-client'),
],
include_directories: inc,