-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[egl] Revise wrapper and pkgconfig files for windows (#28174)
* [egl] Use vcpkg_fixup_pkgconfig * Mingw uses lower case filenames * Document what is wrapped * Do backup before modification * Windows EGL_LIBRARY is unofficial::angle::libEGL * Update versions
- Loading branch information
Showing
6 changed files
with
25 additions
and
54 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
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 |
---|---|---|
@@ -1,55 +1,22 @@ | ||
# Wrapper for FindEGL.cmake in extra-cmake-modules (port ecm) and its vendored copies | ||
|
||
if(UNIX) | ||
find_package(OpenGL COMPONENTS EGL) | ||
if(OPENGL_egl_LIBRARY) | ||
set(EGL_LIBRARY "${OPENGL_egl_LIBRARY}" CACHE STRING "") | ||
set(EGL_INCLUDE_DIR "${OPENGL_EGL_INCLUDE_DIRS}" CACHE STRING "") | ||
endif() | ||
endif() | ||
|
||
set(VCPKG_SETUP_EGL OFF) | ||
if(NOT TARGET EGL::EGL) | ||
set(VCPKG_SETUP_EGL ON) | ||
endif() | ||
|
||
if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND WIN32) | ||
include(SelectLibraryConfigurations) | ||
find_library(GLESv2_LIBRARY_DEBUG NAMES libGLESv2 GLESv2 NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH) | ||
find_library(GLESv2_LIBRARY_RELEASE NAMES libGLESv2 GLESv2 NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) | ||
select_library_configurations(GLESv2) | ||
find_library(ANGLE_LIBRARY_DEBUG NAMES libANGLE ANGLE NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH) | ||
find_library(ANGLE_LIBRARY_RELEASE NAMES libANGLE ANGLE NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) | ||
select_library_configurations(ANGLE) | ||
if(CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]") | ||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${GLESv2_LIBRARY_DEBUG}" "${ANGLE_LIBRARY_DEBUG}" ZLIB::ZLIB D3d9.lib dxguid.lib DXGI.lib) | ||
else() | ||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${GLESv2_LIBRARY_RELEASE}" "${ANGLE_LIBRARY_RELEASE}" ZLIB::ZLIB D3d9.lib dxguid.lib DXGI.lib) | ||
elseif(WIN32) | ||
find_package(unofficial-angle CONFIG) | ||
if(TARGET unofficial::angle::libEGL) | ||
set(EGL_LIBRARY unofficial::angle::libEGL) | ||
if(NOT TARGET EGL::EGL) | ||
add_library(EGL::EGL INTERFACE IMPORTED) | ||
set_target_properties(EGL::EGL PROPERTIES | ||
INTERFACE_LINK_LIBRARIES unofficial::angle::libEGL | ||
) | ||
endif() | ||
endif() | ||
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DKHRONOS_STATIC") | ||
find_package(ZLIB REQUIRED) | ||
set(VCPKG_BACKUP_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") | ||
set(VCPKG_BACKUP_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}") | ||
endif() | ||
|
||
_find_package(${ARGS}) | ||
|
||
if(VCPKG_SETUP_EGL AND TARGET EGL::EGL AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND WIN32) | ||
if(GLESv2_LIBRARY_DEBUG) | ||
set_property(TARGET EGL::EGL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "$<$<CONFIG:DEBUG>:${GLESv2_LIBRARY_DEBUG}>") | ||
endif() | ||
if(ANGLE_LIBRARY_DEBUG) | ||
set_property(TARGET EGL::EGL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "$<$<CONFIG:DEBUG>:${ANGLE_LIBRARY_DEBUG}>") | ||
endif() | ||
if(GLESv2_LIBRARY_RELEASE) | ||
set_property(TARGET EGL::EGL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "$<$<NOT:$<CONFIG:DEBUG>>:${GLESv2_LIBRARY_RELEASE}>") | ||
endif() | ||
if(ANGLE_LIBRARY_RELEASE) | ||
set_property(TARGET EGL::EGL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "$<$<NOT:$<CONFIG:DEBUG>>:${ANGLE_LIBRARY_RELEASE}>") | ||
endif() | ||
set_property(TARGET EGL::EGL APPEND PROPERTY INTERFACE_LINK_LIBRARIES "ZLIB::ZLIB;D3d9.lib;dxguid.lib;DXGI.lib") | ||
set(CMAKE_REQUIRED_LIBRARIES "${VCPKG_BACKUP_CMAKE_REQUIRED_LIBRARIES}") | ||
set(CMAKE_REQUIRED_DEFINITIONS "${VCPKG_BACKUP_CMAKE_REQUIRED_DEFINITIONS}") | ||
unset(VCPKG_BACKUP_CMAKE_REQUIRED_LIBRARIES) | ||
unset(VCPKG_BACKUP_CMAKE_REQUIRED_DEFINITIONS) | ||
endif() | ||
|
||
unset(VCPKG_SETUP_EGL) |
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
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