ci: remove unused libportal check from Librarires.cmake

This commit is contained in:
sithlord48
2024-10-22 20:40:03 -04:00
committed by Nick Bolton
parent dfbd612e2f
commit d5a8dd7927

View File

@ -200,8 +200,6 @@ macro(configure_wayland_libs)
include(FindPkgConfig)
if(PKG_CONFIG_FOUND)
configure_libportal()
pkg_check_modules(LIBXKBCOMMON REQUIRED xkbcommon)
pkg_check_modules(GLIB2 REQUIRED glib-2.0 gio-2.0)
find_library(LIBM m)
@ -213,109 +211,6 @@ macro(configure_wayland_libs)
endmacro()
macro(configure_libportal)
option(SYSTEM_LIBPORTAL "Use system libportal" ON)
if(SYSTEM_LIBPORTAL)
pkg_check_modules(LIBPORTAL REQUIRED QUIET "libportal >= ${LIBPORTAL_MIN_VERSION}")
if(LIBPORTAL_FOUND)
message(STATUS "libportal version: ${LIBPORTAL_VERSION}")
check_libportal()
else()
message(WARNING "libportal >= ${LIBPORTAL_MIN_VERSION} not found")
endif()
else()
set(libportal_bin_dir
${PROJECT_BINARY_DIR}/meson/subprojects/libportal/libportal)
set(libportal_src_dir ${PROJECT_SOURCE_DIR}/subprojects/libportal)
option(LIBPORTAL_STATIC "Use the static libportal binary" OFF)
if(LIBPORTAL_STATIC)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
find_library(
LIBPORTAL_LINK_LIBRARIES
NAMES portal
PATHS ${libportal_bin_dir}
NO_DEFAULT_PATH)
if(LIBPORTAL_LINK_LIBRARIES)
message(STATUS "Using local subproject libportal")
set(LIBPORTAL_FOUND true)
set(LIBPORTAL_INCLUDE_DIRS ${libportal_src_dir})
message(STATUS "libportal library file: ${LIBPORTAL_LINK_LIBRARIES}")
# HACK: Somehow `check_symbol_exists` doesn't pick up on the symbols even though
# they are actually there. Since we use master branch of libportal, for now we'll
# assume that the symbols are there.
set(HAVE_LIBPORTAL_SESSION_CONNECT_TO_EIS true)
set(HAVE_LIBPORTAL_CREATE_REMOTE_DESKTOP_SESSION_FULL true)
set(HAVE_LIBPORTAL_INPUTCAPTURE true)
set(HAVE_LIBPORTAL_OUTPUT_NONE true)
else()
message(WARNING "Local libportal not found")
endif()
endif()
if(LIBPORTAL_FOUND)
add_definitions(-DWINAPI_LIBPORTAL=1)
include_directories(${LIBPORTAL_INCLUDE_DIRS})
endif()
endmacro()
# libportal 0.7 has xdp_session_connect_to_eis but it doesn't have remote desktop session restore or
# the inputcapture code, so let's check for explicit functions that bits depending on what we have
macro(check_libportal)
include(CMakePushCheckState)
include(CheckCXXSourceCompiles)
cmake_push_check_state(RESET)
set(CMAKE_REQUIRED_INCLUDES
"${CMAKE_REQUIRED_INCLUDES};${LIBPORTAL_INCLUDE_DIRS};${GLIB2_INCLUDE_DIRS}"
)
set(CMAKE_REQUIRED_LIBRARIES
"${CMAKE_REQUIRED_LIBRARIES};${LIBPORTAL_LINK_LIBRARIES};${GLIB2_LINK_LIBRARIES}"
)
check_symbol_exists(xdp_session_connect_to_eis "libportal/portal.h"
HAVE_LIBPORTAL_SESSION_CONNECT_TO_EIS)
check_symbol_exists(
xdp_portal_create_remote_desktop_session_full "libportal/portal.h"
HAVE_LIBPORTAL_CREATE_REMOTE_DESKTOP_SESSION_FULL)
check_symbol_exists(xdp_input_capture_session_connect_to_eis
"libportal/inputcapture.h" HAVE_LIBPORTAL_INPUTCAPTURE)
# check_symbol_exists cant check for enum values
check_cxx_source_compiles(
"#include <libportal/portal.h>
int main() { XdpOutputType out = XDP_OUTPUT_NONE; }
" HAVE_LIBPORTAL_OUTPUT_NONE)
cmake_pop_check_state()
if(NOT HAVE_LIBPORTAL_SESSION_CONNECT_TO_EIS)
message(WARNING "xdp_session_connect_to_eis not found")
endif()
if(NOT HAVE_LIBPORTAL_CREATE_REMOTE_DESKTOP_SESSION_FULL)
message(WARNING "xdp_portal_create_remote_desktop_session_full not found")
endif()
if(NOT HAVE_LIBPORTAL_INPUTCAPTURE)
message(WARNING "xdp_input_capture_session_connect_to_eis not found")
endif()
if(NOT HAVE_LIBPORTAL_OUTPUT_NONE)
message(WARNING "XDP_OUTPUT_NONE not found")
endif()
endmacro()
#
# X.org/X11 for Linux, BSD, etc
#