Skip to content

Commit

Permalink
[angle] Rename libs to avoid conflict with system OpenGL. (#27701)
Browse files Browse the repository at this point in the history
* [angle] Rename libs to avoid conflict with system OpenGL.

Note that we already rename the headers in https://github.com/microsoft/vcpkg/blob/e6a79ac0183043994ab21a2c4e0f9cdad8a5421c/ports/angle/portfile.cmake#L77

Also remove what appears to be phantom dependency in qt5-base when not Windows, @Neumann-A reports over Discord https://discord.com/channels/400588936151433218/687365466422902841/1038241263494893649 that they just need any OpenGL implementation.

* Don't rename on Windows.
  • Loading branch information
BillyONeal authored Nov 8, 2022
1 parent ec7216c commit 76a79d9
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 32 deletions.
24 changes: 15 additions & 9 deletions ports/angle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ else()
set(ANGLE_COMMON_PLATFORM_SOURCES )
endif()

file(GLOB ANGLE_COMMON_SOURCES
file(GLOB ANGLE_COMMON_SOURCES
${ANGLE_COMMON_PLATFORM_SOURCES}
"src/common/*.h"
"src/common/*.inc"
Expand Down Expand Up @@ -250,13 +250,13 @@ file(GLOB TRANSLATOR_GLSL_BASE_SOURCES
"src/compiler/translator/OutputGLSLBase.cpp"
"src/compiler/translator/OutputGLSLBase.h"
)
file(GLOB TRANSLATOR_GLSL_AND_VULKAN_BASE_SOURCES
file(GLOB TRANSLATOR_GLSL_AND_VULKAN_BASE_SOURCES
"src/compiler/translator/BuiltinsWorkaroundGLSL.cpp"
"src/compiler/translator/BuiltinsWorkaroundGLSL.h"
"src/compiler/translator/OutputGLSL.cpp"
"src/compiler/translator/OutputGLSL.h"
)
file(GLOB TRANSLATOR_ESSL_SOURCES
file(GLOB TRANSLATOR_ESSL_SOURCES
"src/compiler/translator/OutputESSL.cpp"
"src/compiler/translator/OutputESSL.h"
"src/compiler/translator/TranslatorESSL.cpp"
Expand Down Expand Up @@ -347,12 +347,12 @@ add_library(angle::preprocessor ALIAS angle_preprocessor)
## OpenGL Renderer
if(WINDOWS_DESKTOP OR LINUX OR APPLE)
if(WINDOWS_DESKTOP)
set(ANGLE_RENDERER_OPENGL_PLATFORM
set(ANGLE_RENDERER_OPENGL_PLATFORM
"src/libANGLE/renderer/gl/wgl/*.cpp"
"src/libANGLE/renderer/gl/wgl/*.h"
)
elseif(APPLE)
set(ANGLE_RENDERER_OPENGL_PLATFORM
set(ANGLE_RENDERER_OPENGL_PLATFORM
"src/libANGLE/renderer/gl/cgl/*.mm"
"src/libANGLE/renderer/gl/cgl/*.cpp"
"src/libANGLE/renderer/gl/cgl/*.h"
Expand All @@ -362,7 +362,7 @@ if(WINDOWS_DESKTOP OR LINUX OR APPLE)
"gpu_info_util/SystemInfo_macos.mm"
)
elseif(LINUX)
set(ANGLE_RENDERER_OPENGL_PLATFORM
set(ANGLE_RENDERER_OPENGL_PLATFORM
"src/libANGLE/renderer/gl/glx/*.cpp"
"src/libANGLE/renderer/gl/glx/*.h"
"src/libANGLE/renderer/gl/egl/*.cpp"
Expand Down Expand Up @@ -574,9 +574,9 @@ target_link_libraries(libANGLE PRIVATE
target_include_directories(libANGLE PRIVATE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/third_party/khronos>")
target_compile_definitions(libANGLE
PRIVATE -DANGLE_ENABLE_NULL
PUBLIC
-DLIBANGLE_IMPLEMENTATION
${LIBANGLE_RENDERER_COMPILEDEF}
PUBLIC
-DLIBANGLE_IMPLEMENTATION
${LIBANGLE_RENDERER_COMPILEDEF}
-DANGLE_EXPORT=
-DANGLE_UTIL_EXPORT=
-DEGLAPI=
Expand Down Expand Up @@ -625,6 +625,9 @@ list(APPEND LIBGLESV2_SOURCES
)
add_library(libGLESv2 ${LIBGLESV2_SOURCES})
target_link_libraries(libGLESv2 PRIVATE angle::common angle::libANGLE)
if(NOT VCPKG_TARGET_IS_WINDOWS)
set_property(TARGET libGLESv2 PROPERTY OUTPUT_NAME libGLESv2_angle)
endif()
target_compile_definitions(libGLESv2
PRIVATE -DLIBGLESV2_IMPLEMENTATION
PUBLIC
Expand Down Expand Up @@ -669,6 +672,9 @@ add_library(libEGL
)

target_link_libraries(libEGL PRIVATE angle::common angle::libANGLE libGLESv2)
if(NOT VCPKG_TARGET_IS_WINDOWS)
set_property(TARGET libEGL PROPERTY OUTPUT_NAME libEGL_angle)
endif()
target_include_directories(libEGL PUBLIC "$<INSTALL_INTERFACE:include>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>")
target_compile_definitions(libEGL
PRIVATE
Expand Down
33 changes: 17 additions & 16 deletions ports/angle/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function(checkout_in_path_with_patches PATH URL REF PATCHES)
if(EXISTS "${PATH}")
return()
endif()

vcpkg_from_git(
OUT_SOURCE_PATH DEP_SOURCE_PATH
URL "${URL}"
Expand All @@ -57,7 +57,8 @@ vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=1
OPTIONS
-D${ANGLE_CPU_BITNESS}=1
"-D${ANGLE_CPU_BITNESS}=1"
"-DVCPKG_TARGET_IS_WINDOWS=${VCPKG_TARGET_IS_WINDOWS}"
)

vcpkg_cmake_install()
Expand All @@ -69,26 +70,26 @@ vcpkg_copy_pdbs()
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

# File conflict with opengl-registry! Make sure headers are similar on Update!
# angle defines some additional entrypoints.
# angle defines some additional entrypoints.
# opengl-registry probably needs an upstream update to account for those
# Due to that all angle headers get moved to include/angle.
# If you want to use those instead of the onces provided by opengl-registry make sure
# Due to that all angle headers get moved to include/angle.
# If you want to use those instead of the onces provided by opengl-registry make sure
# VCPKG_INSTALLED_DIR/include/angle is before VCPKG_INSTALLED_DIR/include
file(GLOB_RECURSE angle_includes "${CURRENT_PACKAGES_DIR}/include")
file(COPY ${angle_includes} DESTINATION "${CURRENT_PACKAGES_DIR}/include/angle")

set(_double_files
include/GLES/egl.h
include/GLES/gl.h
include/GLES/glext.h
include/GLES/glplatform.h
include/GLES2/gl2.h
include/GLES2/gl2ext.h
include/GLES2/gl2platform.h
include/GLES3/gl3.h
include/GLES3/gl31.h
include/GLES3/gl32.h
include/GLES3/gl3platform.h)
"include/GLES/egl.h"
"include/GLES/gl.h"
"include/GLES/glext.h"
"include/GLES/glplatform.h"
"include/GLES2/gl2.h"
"include/GLES2/gl2ext.h"
"include/GLES2/gl2platform.h"
"include/GLES3/gl3.h"
"include/GLES3/gl31.h"
"include/GLES3/gl32.h"
"include/GLES3/gl3platform.h")
foreach(_file ${_double_files})
if(EXISTS "${CURRENT_PACKAGES_DIR}/${_file}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/${_file}")
Expand Down
2 changes: 1 addition & 1 deletion ports/angle/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "angle",
"version-string": "chromium_4472",
"port-version": 5,
"port-version": 6,
"description": [
"A conformant OpenGL ES implementation for Windows, Mac and Linux.",
"The goal of ANGLE is to allow users of multiple operating systems to seamlessly run WebGL and other OpenGL ES content by translating OpenGL ES API calls to one of the hardware-supported APIs available for that platform. ANGLE currently provides translation from OpenGL ES 2.0 and 3.0 to desktop OpenGL, OpenGL ES, Direct3D 9, and Direct3D 11. Support for translation from OpenGL ES to Vulkan is underway, and future plans include compute shader support (ES 3.1) and MacOS support."
Expand Down
9 changes: 5 additions & 4 deletions ports/qt5-base/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"name": "qt5-base",
"version": "5.15.7",
"port-version": 1,
"description": "Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.",
"homepage": "https://www.qt.io/",
"license": null,
"dependencies": [
{
"name": "angle",
"platform": "!windows"
},
"double-conversion",
"egl-registry",
{
Expand All @@ -23,6 +20,10 @@
},
"libjpeg-turbo",
"libpng",
{
"name": "opengl",
"platform": "!windows"
},
"openssl",
"pcre2",
{
Expand Down
5 changes: 5 additions & 0 deletions versions/a-/angle.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "d48bbcf1eba07a4156e745140be81caff95b8757",
"version-string": "chromium_4472",
"port-version": 6
},
{
"git-tree": "1c154e795d3d3c736dbbfec2db72a50aa37fa8f2",
"version-string": "chromium_4472",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
},
"angle": {
"baseline": "chromium_4472",
"port-version": 5
"port-version": 6
},
"antlr4": {
"baseline": "4.10.1",
Expand Down Expand Up @@ -6046,7 +6046,7 @@
},
"qt5-base": {
"baseline": "5.15.7",
"port-version": 0
"port-version": 1
},
"qt5-canvas3d": {
"baseline": "0",
Expand Down
5 changes: 5 additions & 0 deletions versions/q-/qt5-base.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "03b57b46f1e3be1f7aa32cfe41ef54ace61cb87f",
"version": "5.15.7",
"port-version": 1
},
{
"git-tree": "e2cd525c7989b5b2a96b9ad5ebaf145c1a549218",
"version": "5.15.7",
Expand Down

0 comments on commit 76a79d9

Please sign in to comment.