From f1d724d25ec5c34dffb6e3d75b4fd62326307e6c Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Sat, 22 Jan 2022 00:05:06 +0300 Subject: [PATCH 1/3] BUILD(client): Disable overlay-xcompile by default on OpenBSD OpenBSD has no 32-bit compatibility layer (on 64-bit architectures), so this does not work by design. --- overlay_gl/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/overlay_gl/CMakeLists.txt b/overlay_gl/CMakeLists.txt index f75984693..a3c4f5019 100644 --- a/overlay_gl/CMakeLists.txt +++ b/overlay_gl/CMakeLists.txt @@ -6,7 +6,9 @@ # Overlay payload for UNIX-like systems. if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "amd64") - option(overlay-xcompile "Build 32 bit overlay library, necessary for the overlay to work with 32 bit processes." ON) + if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") + option(overlay-xcompile "Build 32 bit overlay library, necessary for the overlay to work with 32 bit processes." ON) + endif() endif() add_library(overlay_gl SHARED "overlay.c") From d9f1e47264d63d80242e9935af8eefdbc51f3c05 Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Sat, 22 Jan 2022 01:20:34 +0300 Subject: [PATCH 2/3] BUILD(client, overlay): Require libGL includes `` is part of OpenBSD's X version and thus part of the base system, X however lives under its own /usr/X11R6/; let pkg-config(1) take care of this. --- overlay_gl/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/overlay_gl/CMakeLists.txt b/overlay_gl/CMakeLists.txt index a3c4f5019..08c19f625 100644 --- a/overlay_gl/CMakeLists.txt +++ b/overlay_gl/CMakeLists.txt @@ -21,6 +21,9 @@ set_target_properties(overlay_gl ) if(NOT APPLE) + find_pkg(gl REQUIRED) + target_include_directories(overlay_gl PRIVATE ${gl_INCLUDE_DIRS}) + target_link_options(overlay_gl BEFORE PRIVATE "-Wl,-z,lazy" From 501a9e8253d069ea5c52de83bdc0a6e2a6f81141 Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Sat, 22 Jan 2022 01:42:27 +0300 Subject: [PATCH 3/3] BUILD(client): Do not build overlay by default on OpenBSD `overlay_gl/init_unix.c` is inherently Linux and FreeBSD specific, so the build will fail until an OpenBSD implementation exists. --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 560e2b31b..27b9eda5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,9 @@ option(static "Build static binaries." OFF) option(symbols "Build binaries in a way that allows easier debugging." OFF) option(warnings-as-errors "All warnings are treated as errors." ON) -option(overlay "Build overlay." ON) +if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD") + option(overlay "Build overlay." ON) +endif() option(packaging "Build package." OFF) option(plugins "Build plugins." ON)