From 54b5467ec12fb115b537e0c86256226474edf8bb Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Mon, 18 Sep 2023 19:00:21 +0000 Subject: [PATCH] build: Unbreak build on FreeBSD (#98) * helpers: add missing header after 9dfb9e125bf0 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 2f48e6550374 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()) --- CMakeLists.txt | 4 +++- src/helpers/MiscFunctions.cpp | 1 + src/meson.build | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e39b72c..44d1689 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index da05ee6..353c8f0 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -1,5 +1,6 @@ #include "MiscFunctions.hpp" #include +#include #include "../helpers/Log.hpp" std::string execAndGet(const char* cmd) { diff --git a/src/meson.build b/src/meson.build index 444d3bd..c3d3735 100644 --- a/src/meson.build +++ b/src/meson.build @@ -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,