mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 20:42:21 +00:00
Meta: Patch angle vcpkg to build on FreeBSD
This commit is contained in:
parent
6645e4efbb
commit
1a42fc4fcd
Notes:
github-actions[bot]
2025-07-15 19:46:47 +00:00
Author: https://github.com/cqundefine
Commit: 1a42fc4fcd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5244
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/clausecker
Reviewed-by: https://github.com/trflynn89
5 changed files with 63 additions and 3 deletions
|
@ -44,7 +44,7 @@ add_compile_options("$<$<CONFIG:DEBUG>:-DANGLE_ENABLE_DEBUG_ANNOTATIONS>")
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
add_definitions(-DANGLE_IS_WIN)
|
add_definitions(-DANGLE_IS_WIN)
|
||||||
endif()
|
endif()
|
||||||
if(LINUX)
|
if(LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
||||||
add_definitions(-DANGLE_IS_LINUX)
|
add_definitions(-DANGLE_IS_LINUX)
|
||||||
endif()
|
endif()
|
||||||
if(ANGLE_IS_64_BIT_CPU)
|
if(ANGLE_IS_64_BIT_CPU)
|
||||||
|
@ -258,6 +258,9 @@ if (USE_ANGLE_EGL OR ENABLE_WEBGL)
|
||||||
target_compile_definitions(ANGLE PUBLIC ${ANGLE_DEFINITIONS})
|
target_compile_definitions(ANGLE PUBLIC ${ANGLE_DEFINITIONS})
|
||||||
target_link_libraries(ANGLE PRIVATE ZLIB::ZLIB ${CMAKE_DL_LIBS})
|
target_link_libraries(ANGLE PRIVATE ZLIB::ZLIB ${CMAKE_DL_LIBS})
|
||||||
|
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
target_link_libraries(ANGLE PRIVATE Threads::Threads)
|
||||||
|
|
||||||
target_compile_definitions(ANGLEFramework INTERFACE ${gl_prototypes})
|
target_compile_definitions(ANGLEFramework INTERFACE ${gl_prototypes})
|
||||||
|
|
||||||
add_library(GLESv2 ${GLESv2_LIBRARY_TYPE}
|
add_library(GLESv2 ${GLESv2_LIBRARY_TYPE}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
list(APPEND ANGLE_DEFINITIONS ANGLE_PLATFORM_LINUX USE_SYSTEM_EGL)
|
list(APPEND ANGLE_DEFINITIONS USE_SYSTEM_EGL)
|
||||||
include(linux.cmake)
|
include(linux.cmake)
|
||||||
|
|
||||||
if (USE_OPENGL)
|
if (USE_OPENGL)
|
||||||
|
|
56
Meta/CMake/vcpkg/overlay-ports/angle/fix-freebsd.patch
Normal file
56
Meta/CMake/vcpkg/overlay-ports/angle/fix-freebsd.patch
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
diff --git a/src/common/platform.h b/src/common/platform.h
|
||||||
|
index 44f485f1ce..fbbbfa7919 100644
|
||||||
|
--- a/src/common/platform.h
|
||||||
|
+++ b/src/common/platform.h
|
||||||
|
@@ -23,7 +23,10 @@
|
||||||
|
#elif defined(__linux__) || defined(EMSCRIPTEN)
|
||||||
|
# define ANGLE_PLATFORM_LINUX 1
|
||||||
|
# define ANGLE_PLATFORM_POSIX 1
|
||||||
|
-#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || \
|
||||||
|
+#elif defined(__FreeBSD__)
|
||||||
|
+# define ANGLE_PLATFORM_FREEBSD 1
|
||||||
|
+# define ANGLE_PLATFORM_POSIX 1
|
||||||
|
+#elif defined(__OpenBSD__) || defined(__NetBSD__) || \
|
||||||
|
defined(__DragonFly__) || defined(__sun) || defined(__GLIBC__) || defined(__GNU__) || \
|
||||||
|
defined(__QNX__) || defined(__Fuchsia__) || defined(__HAIKU__)
|
||||||
|
# define ANGLE_PLATFORM_POSIX 1
|
||||||
|
diff --git a/src/libANGLE/Display.cpp b/src/libANGLE/Display.cpp
|
||||||
|
index d261bf1e5a..44c1d91bc3 100644
|
||||||
|
--- a/src/libANGLE/Display.cpp
|
||||||
|
+++ b/src/libANGLE/Display.cpp
|
||||||
|
@@ -58,7 +58,7 @@
|
||||||
|
# include "libANGLE/renderer/gl/wgl/DisplayWGL.h"
|
||||||
|
# elif ANGLE_ENABLE_CGL
|
||||||
|
# include "libANGLE/renderer/gl/cgl/DisplayCGL.h"
|
||||||
|
-# elif defined(ANGLE_PLATFORM_LINUX)
|
||||||
|
+# elif defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_FREEBSD)
|
||||||
|
# include "libANGLE/renderer/gl/egl/DisplayEGL.h"
|
||||||
|
# if defined(ANGLE_USE_X11)
|
||||||
|
# include "libANGLE/renderer/gl/glx/DisplayGLX_api.h"
|
||||||
|
@@ -422,7 +422,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib displayType,
|
||||||
|
impl = new rx::DisplayCGL(state);
|
||||||
|
break;
|
||||||
|
|
||||||
|
-# elif defined(ANGLE_PLATFORM_LINUX)
|
||||||
|
+# elif defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_FREEBSD)
|
||||||
|
# if defined(ANGLE_USE_GBM)
|
||||||
|
if (platformType == 0)
|
||||||
|
{
|
||||||
|
@@ -468,7 +468,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib displayType,
|
||||||
|
#if defined(ANGLE_ENABLE_OPENGL)
|
||||||
|
# if defined(ANGLE_PLATFORM_WINDOWS)
|
||||||
|
impl = new rx::DisplayWGL(state);
|
||||||
|
-# elif defined(ANGLE_PLATFORM_LINUX)
|
||||||
|
+# elif defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_FREEBSD)
|
||||||
|
# if defined(ANGLE_USE_GBM)
|
||||||
|
if (platformType == 0)
|
||||||
|
{
|
||||||
|
@@ -519,7 +519,7 @@ rx::DisplayImpl *CreateDisplayFromAttribs(EGLAttrib displayType,
|
||||||
|
impl = rx::CreateVulkanWin32Display(state);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
-# elif defined(ANGLE_PLATFORM_LINUX)
|
||||||
|
+# elif defined(ANGLE_PLATFORM_LINUX) || defined(ANGLE_PLATFORM_FREEBSD)
|
||||||
|
# if defined(ANGLE_USE_GBM)
|
||||||
|
if (platformType == EGL_PLATFORM_GBM_KHR && rx::IsVulkanGbmDisplayAvailable())
|
||||||
|
{
|
|
@ -49,6 +49,7 @@ vcpkg_from_github(
|
||||||
# On update check headers against opengl-registry
|
# On update check headers against opengl-registry
|
||||||
PATCHES
|
PATCHES
|
||||||
001-fix-builder-error.patch
|
001-fix-builder-error.patch
|
||||||
|
fix-freebsd.patch
|
||||||
)
|
)
|
||||||
|
|
||||||
# Generate angle_commit.h
|
# Generate angle_commit.h
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "angle",
|
"name": "angle",
|
||||||
"platform": "linux | windows | android"
|
"platform": "linux | windows | android | freebsd"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "curl",
|
"name": "curl",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue