-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#20905) freeglut: Add support for Wayland
* freeglut: Add support for Wayland * Add patch for 3.2.2 * Use VirtualBuildEnv * Ensure that the GLES libraries are linked in from the libglvnd Conan package * Revert "Use VirtualBuildEnv" This reverts commit b32ddc8. * Drop v1 test packages * Bump CMake minimum required to 3.11 to enable policy CMP0072 * Bump the minimum required CMake version * Add a patch to include a missing function definition * Update patches to match the fixes merged upstream * Add patch to pick up the correct GLES libraries * Only allow the gles option on Linux and FreeBSD * Set default for get_safe * Default GLES as the upstream project does
- Loading branch information
1 parent
584c8d8
commit c87d051
Showing
15 changed files
with
636 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
...freeglut/all/patches/3.2.1-0001-Use-find_package-and-pkg_check_modules-to-find-more.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
From 4c573afc0453f3572c494d22b4f3bad9a9ce4073 Mon Sep 17 00:00:00 2001 | ||
From: Jordan Williams <jordan@jwillikers.com> | ||
Date: Tue, 7 Nov 2023 07:38:42 -0600 | ||
Subject: [PATCH] Use find_package and pkg_check_modules to find more | ||
dependencies | ||
|
||
This commit enhances the use of the FindOpenGL CMake module. | ||
This requires CMake version 3.10 for the OpenGL::EGL imported target. | ||
CMake 3.11 and later enable CMake policy CMP0072. | ||
This prefers the GLVND libraries when available. | ||
|
||
Finds the Wayland and xkbcommon dependencies with pkg_check_modules. | ||
This works with the pkg-config files provided by the upstream projects. | ||
--- | ||
CMakeLists.txt | 53 +++++++++++++++++++++++++++++++++++++++++++------- | ||
1 file changed, 46 insertions(+), 7 deletions(-) | ||
|
||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 6f403afa..a2a95c02 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -1,5 +1,9 @@ | ||
-CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0 FATAL_ERROR) | ||
-PROJECT(freeglut) | ||
+CMAKE_MINIMUM_REQUIRED(VERSION 3.1 FATAL_ERROR) | ||
+PROJECT(freeglut LANGUAGES C) | ||
+ | ||
+if (POLICY CMP0072) | ||
+ cmake_policy(SET CMP0072 NEW) | ||
+endif() | ||
|
||
# for multiarch LIBDIR support (requires cmake>=2.8.8) | ||
INCLUDE(GNUInstallDirs) | ||
@@ -257,17 +261,52 @@ ENDIF() | ||
# GLES1 and GLES2 libraries are compatible and can be co-linked. | ||
IF(FREEGLUT_GLES) | ||
LIST(APPEND PUBLIC_DEFINITIONS -DFREEGLUT_GLES) | ||
- LIST(APPEND LIBS GLESv2 GLESv1_CM EGL) | ||
+ if(NOT CMAKE_VERSION VERSION_LESS "3.27") | ||
+ FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL GLES2 OpenGL) | ||
+ LIST(APPEND LIBS GLESv1_CM OpenGL::EGL OpenGL::GLES2 OpenGL::OpenGL) | ||
+ elseif(NOT CMAKE_VERSION VERSION_LESS "3.10") | ||
+ FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL OpenGL) | ||
+ LIST(APPEND LIBS GLESv2 GLESv1_CM OpenGL::EGL OpenGL::OpenGL) | ||
+ else() | ||
+ FIND_PACKAGE(OpenGL REQUIRED) | ||
+ LIST(APPEND LIBS EGL GLESv2 GLESv1_CM) | ||
+ endif() | ||
ELSE() | ||
- FIND_PACKAGE(OpenGL REQUIRED) | ||
- LIST(APPEND LIBS ${OPENGL_gl_LIBRARY}) | ||
- INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) | ||
+ if(NOT CMAKE_VERSION VERSION_LESS "3.10") | ||
+ FIND_PACKAGE(OpenGL REQUIRED COMPONENTS OpenGL) | ||
+ LIST(APPEND LIBS OpenGL::GL) | ||
+ else() | ||
+ FIND_PACKAGE(OpenGL REQUIRED) | ||
+ LIST(APPEND LIBS ${OPENGL_gl_LIBRARY}) | ||
+ INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) | ||
+ endif() | ||
ENDIF() | ||
|
||
# For Wayland: compile with -DFREEGLUT_WAYLAND and pull EGL | ||
IF(FREEGLUT_WAYLAND) | ||
ADD_DEFINITIONS(-DFREEGLUT_WAYLAND) | ||
- LIST(APPEND LIBS wayland-client wayland-cursor wayland-egl EGL xkbcommon) | ||
+ INCLUDE(FindPkgConfig) | ||
+ if(NOT CMAKE_VERSION VERSION_LESS "3.10") | ||
+ FIND_PACKAGE(OpenGL REQUIRED COMPONENTS EGL OpenGL) | ||
+ LIST(APPEND LIBS OpenGL::EGL OpenGL::OpenGL) | ||
+ else() | ||
+ FIND_PACKAGE(OpenGL REQUIRED) | ||
+ LIST(APPEND LIBS EGL) | ||
+ endif() | ||
+ if(NOT CMAKE_VERSION VERSION_LESS "3.6") | ||
+ PKG_CHECK_MODULES(wayland-client REQUIRED IMPORTED_TARGET wayland-client) | ||
+ PKG_CHECK_MODULES(wayland-cursor REQUIRED IMPORTED_TARGET wayland-cursor) | ||
+ PKG_CHECK_MODULES(wayland-egl REQUIRED IMPORTED_TARGET wayland-egl) | ||
+ PKG_CHECK_MODULES(xkbcommon REQUIRED IMPORTED_TARGET xkbcommon) | ||
+ LIST(APPEND LIBS PkgConfig::wayland-client PkgConfig::wayland-cursor PkgConfig::wayland-egl PkgConfig::xkbcommon) | ||
+ else() | ||
+ PKG_CHECK_MODULES(wayland-client REQUIRED) | ||
+ PKG_CHECK_MODULES(wayland-cursor REQUIRED) | ||
+ PKG_CHECK_MODULES(wayland-egl REQUIRED) | ||
+ PKG_CHECK_MODULES(xkbcommon REQUIRED) | ||
+ LIST(APPEND LIBS ${wayland-client_LINK_LIBRARIES} ${wayland-cursor_LINK_LIBRARIES} ${wayland-egl_LINK_LIBRARIES} ${xkbcommon_LINK_LIBRARIES}) | ||
+ INCLUDE_DIRECTORIES(${wayland-client_INCLUDE_DIRS} ${wayland-cursor_INCLUDE_DIRS} ${wayland-egl_INCLUDE_DIRS} ${xkbcommon_INCLUDE_DIRS}) | ||
+ endif() | ||
ENDIF() | ||
|
||
# lib m for math, not needed on windows | ||
-- | ||
2.41.0 | ||
|
25 changes: 25 additions & 0 deletions
25
...reeglut/all/patches/3.2.1-0002-fixed-android-undefined-reference-to-glutCreateMenuU.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From 782e63b2eacd47155864d0d1d9b70615418e3083 Mon Sep 17 00:00:00 2001 | ||
From: Jonatha Gabriel <jonathagabrielns@gmail.com> | ||
Date: Sun, 4 Sep 2022 23:25:23 -0300 | ||
Subject: [PATCH] fixed android undefined reference to glutCreateMenuUcall | ||
|
||
--- | ||
src/gles_stubs.c | 2 ++ | ||
1 file changed, 2 insertions(+) | ||
|
||
diff --git a/src/gles_stubs.c b/src/gles_stubs.c | ||
index bc87c0d8..63a19209 100644 | ||
--- a/src/gles_stubs.c | ||
+++ b/src/gles_stubs.c | ||
@@ -18,6 +18,8 @@ GLboolean fgCheckActiveMenu ( SFG_Window *window, int button, GLboolean pressed, | ||
return GL_FALSE; | ||
} | ||
|
||
+int FGAPIENTRY glutCreateMenuUcall( FGCBMenuUC callback, FGCBUserData userData ) { return 0; } | ||
+ | ||
int glutCreateMenu( void (* callback)( int menu ) ) { return 0; } | ||
void glutDestroyMenu( int menu ) {} | ||
int glutGetMenu( void ) { return 0; } | ||
-- | ||
2.41.0 | ||
|
Oops, something went wrong.