chore: got build working on mac (kind of)

This commit is contained in:
2025-12-18 01:29:32 +03:00
parent 57c3c55a94
commit 1a1747a472
8 changed files with 160 additions and 104 deletions

View File

@@ -8,6 +8,21 @@ if(WIN32)
URL https://download.savannah.gnu.org/releases/freetype/freetype-2.14.1.tar.gz
)
FetchContent_MakeAvailable(freetype)
elseif(APPLE)
option(USE_SYSTEM_GLFW ON)
find_package(Freetype REQUIRED)
find_package(ZLIB REQUIRED)
find_package(BZip2 REQUIRED)
find_package(PNG REQUIRED)
find_library(BROTLIDEC_LIBRARY NAMES brotlidec)
find_library(BROTLICOMMON_LIBRARY NAMES brotlicommon)
find_package(PkgConfig QUIET)
if(PkgConfig_FOUND)
pkg_check_modules(HARFBUZZ harfbuzz)
endif()
else()
find_package(Freetype REQUIRED)
find_package(PkgConfig REQUIRED)
@@ -24,13 +39,24 @@ else()
pkg_check_modules(WAYLAND_EGL wayland-egl)
endif()
if (LINUX)
if(LINUX)
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
endif()
if(USE_SYSTEM_GLFW)
pkg_check_modules(GLFW REQUIRED glfw3)
if(APPLE)
find_package(glfw3 QUIET)
if(glfw3_FOUND)
set(GLFW_FOUND TRUE)
set(GLFW_LIBRARIES glfw)
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(GLFW REQUIRED glfw3)
endif()
else()
pkg_check_modules(GLFW REQUIRED glfw3)
endif()
else()
include(FetchContent)
FetchContent_Declare(
@@ -62,12 +88,13 @@ if(HARFBUZZ_FOUND)
endif()
set(WAYLAND_LIBS "")
if(WAYLAND_CLIENT_FOUND)
list(APPEND WAYLAND_LIBS ${WAYLAND_CLIENT_LIBRARIES})
message(STATUS "Found Wayland client")
endif()
if(WAYLAND_EGL_FOUND)
list(APPEND WAYLAND_LIBS ${WAYLAND_EGL_LIBRARIES})
message(STATUS "Found Wayland EGL")
endif()
if(NOT APPLE)
if(WAYLAND_CLIENT_FOUND)
list(APPEND WAYLAND_LIBS ${WAYLAND_CLIENT_LIBRARIES})
message(STATUS "Found Wayland client")
endif()
if(WAYLAND_EGL_FOUND)
list(APPEND WAYLAND_LIBS ${WAYLAND_EGL_LIBRARIES})
message(STATUS "Found Wayland EGL")
endif()
endif()