From c1d07fa842de408a6df86b1627671d833ad20e00 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 2 Aug 2021 18:30:27 +0200 Subject: [PATCH 1/3] Fix import lib prefixes --- ports/angle/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/angle/CMakeLists.txt b/ports/angle/CMakeLists.txt index c00c3d0ea650fc..ad0fe8b3c4f424 100644 --- a/ports/angle/CMakeLists.txt +++ b/ports/angle/CMakeLists.txt @@ -679,9 +679,9 @@ if(NOT BUILD_SHARED_LIBS) add_definitions("-DANGLE_EXPORT=" "-DANGLE_UTIL_EXPORT=" "-DEGLAPI=" "-DGL_APICALL=" "-DGL_API=") endif() -SET_TARGET_PROPERTIES(libANGLE PROPERTIES PREFIX "") -SET_TARGET_PROPERTIES(libGLESv2 PROPERTIES PREFIX "") -SET_TARGET_PROPERTIES(libEGL PROPERTIES PREFIX "") +set_target_properties(libANGLE PROPERTIES PREFIX "") +set_target_properties(libGLESv2 PROPERTIES PREFIX "" IMPORT_PREFIX "") +set_target_properties(libEGL PROPERTIES PREFIX "" IMPORT_PREFIX "") install(TARGETS libEGL libGLESv2 libANGLE angle_common angle_compression_utils angle_image_util angle_gpu_info_util angle_translator angle_preprocessor GL_VISIBILITY EXPORT ANGLEExport RUNTIME DESTINATION bin From e6bfa0ea796e3cbd80116c21318e789765dcd85a Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 2 Aug 2021 18:32:39 +0200 Subject: [PATCH 2/3] Fix mingw build --- ports/angle/003-fix-mingw.patch | 22 ++++++++++++++++++++++ ports/angle/CMakeLists.txt | 11 +++++++++-- ports/angle/portfile.cmake | 1 + ports/angle/vcpkg.json | 1 + 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 ports/angle/003-fix-mingw.patch diff --git a/ports/angle/003-fix-mingw.patch b/ports/angle/003-fix-mingw.patch new file mode 100644 index 00000000000000..304d822ec58a86 --- /dev/null +++ b/ports/angle/003-fix-mingw.patch @@ -0,0 +1,22 @@ +diff --git a/src/common/mathutil.h b/src/common/mathutil.h +index 1d73bbf..c5b9cc8 100644 +--- a/src/common/mathutil.h ++++ b/src/common/mathutil.h +@@ -1073,7 +1073,7 @@ inline int BitCount(uint64_t bits) + # endif // defined(_M_IX86) || defined(_M_X64) + #endif // defined(_MSC_VER) && !defined(__clang__) + +-#if defined(ANGLE_PLATFORM_POSIX) || defined(__clang__) ++#if defined(ANGLE_PLATFORM_POSIX) || defined(__clang__) || defined(__MINGW32__) + inline int BitCount(uint32_t bits) + { + return __builtin_popcount(bits); +@@ -1083,7 +1083,7 @@ inline int BitCount(uint64_t bits) + { + return __builtin_popcountll(bits); + } +-#endif // defined(ANGLE_PLATFORM_POSIX) || defined(__clang__) ++#endif // defined(ANGLE_PLATFORM_POSIX) || defined(__clang__) || defined(__MINGW32__) + + inline int BitCount(uint8_t bits) + { diff --git a/ports/angle/CMakeLists.txt b/ports/angle/CMakeLists.txt index ad0fe8b3c4f424..24ab01d863aa9b 100644 --- a/ports/angle/CMakeLists.txt +++ b/ports/angle/CMakeLists.txt @@ -375,6 +375,9 @@ if(WIN32) "src/libANGLE/renderer/d3d/*.h" ) list(FILTER LIBANGLE_D3D_SOURCES EXCLUDE REGEX "_unittest") + if(MINGW) + list(FILTER LIBANGLE_D3D_SOURCES EXCLUDE REGEX "CompositorNativeWindow11") + endif() ## WinRT D3D Renderer if(WINDOWS_STORE) @@ -406,8 +409,12 @@ if(WIN32) target_compile_definitions(angle_renderer_d3d INTERFACE -DANGLE_ENABLE_D3D11 "-DANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ \"d3dcompiler_47.dll\", \"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }" - -DANGLE_ENABLE_D3D11_COMPOSITOR_NATIVE_WINDOW - ) + ) + if(NOT MINGW) + target_compile_definitions(angle_renderer_d3d INTERFACE + -DANGLE_ENABLE_D3D11_COMPOSITOR_NATIVE_WINDOW + ) + endif() target_link_libraries(angle_renderer_d3d INTERFACE d3d11 dxguid) add_library(angle::renderer::d3d ALIAS angle_renderer_d3d) endif() diff --git a/ports/angle/portfile.cmake b/ports/angle/portfile.cmake index 35c38074f824e4..ed604ecb420eb4 100644 --- a/ports/angle/portfile.cmake +++ b/ports/angle/portfile.cmake @@ -24,6 +24,7 @@ vcpkg_from_github( PATCHES 001-fix-uwp.patch 002-fix-builder-error.patch + 003-fix-mingw.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) diff --git a/ports/angle/vcpkg.json b/ports/angle/vcpkg.json index 0987e6c86636b7..3dc8b17df8ea60 100644 --- a/ports/angle/vcpkg.json +++ b/ports/angle/vcpkg.json @@ -1,6 +1,7 @@ { "name": "angle", "version-string": "chromium_4472", + "port-version": 1, "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." From bb5c6f77900561b265454552ffe2386d3eba85ac Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 2 Aug 2021 18:34:15 +0200 Subject: [PATCH 3/3] x-add-version --- versions/a-/angle.json | 5 +++++ versions/baseline.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/a-/angle.json b/versions/a-/angle.json index bbff894c6f55ef..74633bb496d3ac 100644 --- a/versions/a-/angle.json +++ b/versions/a-/angle.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "d59efcadc61eb7a7be987e4dcc03540490af89b8", + "version-string": "chromium_4472", + "port-version": 1 + }, { "git-tree": "5bd610babb6f0fb15119aa94644494c0dc2bcd2c", "version-string": "chromium_4472", diff --git a/versions/baseline.json b/versions/baseline.json index ae0396a56267b4..13b6018722314b 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -82,7 +82,7 @@ }, "angle": { "baseline": "chromium_4472", - "port-version": 0 + "port-version": 1 }, "antlr4": { "baseline": "4.9.1",