mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-27 19:59:06 +08:00
[angle] Update to chromium/5414, improve build system (and future updates) (#27444)
* [angle] Update to chromium/5249 - Refactor build system based on WebKit's CMake build system for libANGLE - Add maintainer-notes.md * [angle] Fetch & generate more files in portfile * [angle] Move maintainer-notes.md * [angle] Port changes from #27701 * Merge install tweak from #28547 * [angle] Tweak PlatformLinux * Run x-add-version * [angle] Update to chromium/5414 * Run x-add-version * Fix version database. * Fix version database --------- Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com> Co-authored-by: Jonliu1993 <13720414433@163.com>
This commit is contained in:
parent
cfad9356c4
commit
691244117b
@ -1,764 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(angle CXX C)
|
||||
|
||||
if(WIN32 AND NOT WINDOWS_STORE)
|
||||
set(WINDOWS_DESKTOP 1)
|
||||
else()
|
||||
set(WINDOWS_DESKTOP 0)
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(LINUX 1)
|
||||
else()
|
||||
set(LINUX 0)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options(/d2guard4 /Wv:18 /guard:cf /permissive /bigobj)
|
||||
else()
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation -framework IOSurface -framework QuartzCore -framework CoreGraphics")
|
||||
endif()
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
|
||||
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|
||||
|
||||
if (WINDOWS_STORE)
|
||||
set(WINRT_DEFINES -DANGLE_ENABLE_WINDOWS_UWP -DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP)
|
||||
else()
|
||||
set(WINRT_DEFINES)
|
||||
endif()
|
||||
add_definitions(
|
||||
-D_CRT_SECURE_NO_DEPRECATE
|
||||
-D_SCL_SECURE_NO_WARNINGS
|
||||
-DGL_SILENCE_DEPRECATION
|
||||
-D_HAS_EXCEPTIONS=0
|
||||
-DNOMINMAX
|
||||
-DANGLE_STANDALONE_BUILD
|
||||
${WINRT_DEFINES}
|
||||
)
|
||||
add_compile_options("$<$<CONFIG:DEBUG>:-DANGLE_ENABLE_DEBUG_ANNOTATIONS>")
|
||||
if(WIN32)
|
||||
add_definitions(-DANGLE_IS_WIN)
|
||||
endif()
|
||||
if(LINUX)
|
||||
add_definitions(-DANGLE_IS_LINUX)
|
||||
endif()
|
||||
if(ANGLE_IS_64_BIT_CPU)
|
||||
add_definitions(-DANGLE_IS_64_BIT_CPU)
|
||||
elseif(ANGLE_IS_32_BIT_CPU)
|
||||
add_definitions(-DANGLE_IS_32_BIT_CPU)
|
||||
endif()
|
||||
|
||||
configure_file(angle_commit.h include/id/commit.h COPYONLY)
|
||||
#include_directories(include src ${CMAKE_CURRENT_BINARY_DIR}/include)
|
||||
include_directories("$<INSTALL_INTERFACE:include>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>" "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>")
|
||||
##########
|
||||
# angle::common
|
||||
if(WINDOWS_DESKTOP)
|
||||
set(ANGLE_COMMON_PLATFORM_FILTER "_linux|_apple|_mac|_ios|_posix|_winuwp")
|
||||
elseif(WINDOWS_STORE)
|
||||
set(ANGLE_COMMON_PLATFORM_FILTER "_linux|_apple|_mac|_ios|_posix|_win32")
|
||||
elseif(LINUX)
|
||||
set(ANGLE_COMMON_PLATFORM_FILTER "_win|_apple|_mac|_ios")
|
||||
elseif(APPLE)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Darwin") # macOS
|
||||
set(ANGLE_COMMON_PLATFORM_FILTER "_linux|_win|_ios")
|
||||
else() # other Apple platforms (iOS, etc)
|
||||
set(ANGLE_COMMON_PLATFORM_FILTER "_linux|_win|_mac")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
set(ANGLE_COMMON_PLATFORM_SOURCES
|
||||
"src/common/apple/*.h"
|
||||
"src/common/apple/*.cpp"
|
||||
"src/common/apple/*.mm"
|
||||
"src/common/gl/cgl/*.h"
|
||||
"src/common/gl/cgl/*.cpp"
|
||||
"src/common/gl/cgl/*.mm")
|
||||
else()
|
||||
set(ANGLE_COMMON_PLATFORM_SOURCES )
|
||||
endif()
|
||||
|
||||
file(GLOB ANGLE_COMMON_SOURCES
|
||||
${ANGLE_COMMON_PLATFORM_SOURCES}
|
||||
"src/common/*.h"
|
||||
"src/common/*.inc"
|
||||
"src/common/*.cpp"
|
||||
"src/common/third_party/base/anglebase/*.h"
|
||||
"src/common/third_party/base/anglebase/*.cc"
|
||||
"src/common/third_party/base/anglebase/containers/*.h"
|
||||
"src/common/third_party/base/anglebase/numerics/*.h"
|
||||
"src/common/third_party/base/anglebase/numerics/*.cc"
|
||||
"src/common/third_party/xxhash/*.h"
|
||||
"src/common/third_party/xxhash/*.c"
|
||||
"src/common/third_party/smhasher/src/*.h"
|
||||
"src/common/third_party/smhasher/src/*.cpp"
|
||||
)
|
||||
list(FILTER ANGLE_COMMON_SOURCES EXCLUDE REGEX "_unittest|event_tracer|${ANGLE_COMMON_PLATFORM_FILTER}")
|
||||
add_library(angle_common OBJECT ${ANGLE_COMMON_SOURCES})
|
||||
target_include_directories(angle_common PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/common/third_party/base>")
|
||||
add_library(angle::common ALIAS angle_common)
|
||||
|
||||
##########
|
||||
# angle::compression
|
||||
file(GLOB ANGLE_COMPRESSION_UTILS_SOURCES "third_party/zlib/google/compression_utils_portable.*")
|
||||
find_package(ZLIB REQUIRED)
|
||||
add_library(angle_compression_utils OBJECT ${ANGLE_COMPRESSION_UTILS_SOURCES})
|
||||
target_link_libraries(angle_compression_utils PUBLIC ZLIB::ZLIB)
|
||||
target_compile_definitions(angle_compression_utils PRIVATE
|
||||
-DUSE_SYSTEM_ZLIB
|
||||
)
|
||||
target_include_directories(angle_compression_utils INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/third_party/zlib/google>")
|
||||
add_library(angle::compression ALIAS angle_compression_utils)
|
||||
|
||||
##########
|
||||
# angle::image_util
|
||||
file(GLOB ANGLE_IMAGE_UTIL_SOURCES "src/image_util/*.h" "src/image_util/*.inc" "src/image_util/*.cpp")
|
||||
add_library(angle_image_util OBJECT ${ANGLE_IMAGE_UTIL_SOURCES})
|
||||
target_link_libraries(angle_image_util PRIVATE angle::common)
|
||||
add_library(angle::image_util ALIAS angle_image_util)
|
||||
|
||||
##########
|
||||
# angle::translator
|
||||
file(GLOB TRANSLATOR_SOURCES
|
||||
"src/compiler/translator/BaseTypes.h"
|
||||
"src/compiler/translator/BuiltInFunctionEmulator.cpp"
|
||||
"src/compiler/translator/BuiltInFunctionEmulator.h"
|
||||
"src/compiler/translator/CallDAG.cpp"
|
||||
"src/compiler/translator/CallDAG.h"
|
||||
"src/compiler/translator/CodeGen.cpp"
|
||||
"src/compiler/translator/CollectVariables.cpp"
|
||||
"src/compiler/translator/CollectVariables.h"
|
||||
"src/compiler/translator/Common.h"
|
||||
"src/compiler/translator/Compiler.cpp"
|
||||
"src/compiler/translator/Compiler.h"
|
||||
"src/compiler/translator/ConstantUnion.cpp"
|
||||
"src/compiler/translator/ConstantUnion.h"
|
||||
"src/compiler/translator/Declarator.cpp"
|
||||
"src/compiler/translator/Declarator.h"
|
||||
"src/compiler/translator/Diagnostics.cpp"
|
||||
"src/compiler/translator/Diagnostics.h"
|
||||
"src/compiler/translator/DirectiveHandler.cpp"
|
||||
"src/compiler/translator/DirectiveHandler.h"
|
||||
"src/compiler/translator/ExtensionBehavior.cpp"
|
||||
"src/compiler/translator/ExtensionBehavior.h"
|
||||
"src/compiler/translator/FlagStd140Structs.cpp"
|
||||
"src/compiler/translator/FlagStd140Structs.h"
|
||||
"src/compiler/translator/FunctionLookup.cpp"
|
||||
"src/compiler/translator/FunctionLookup.h"
|
||||
"src/compiler/translator/HashNames.cpp"
|
||||
"src/compiler/translator/HashNames.h"
|
||||
"src/compiler/translator/ImmutableString.h"
|
||||
"src/compiler/translator/ImmutableStringBuilder.cpp"
|
||||
"src/compiler/translator/ImmutableStringBuilder.h"
|
||||
"src/compiler/translator/InfoSink.cpp"
|
||||
"src/compiler/translator/InfoSink.h"
|
||||
"src/compiler/translator/Initialize.cpp"
|
||||
"src/compiler/translator/Initialize.h"
|
||||
"src/compiler/translator/InitializeDll.cpp"
|
||||
"src/compiler/translator/InitializeDll.h"
|
||||
"src/compiler/translator/InitializeGlobals.h"
|
||||
"src/compiler/translator/IntermNode.cpp"
|
||||
"src/compiler/translator/IntermNode.h"
|
||||
"src/compiler/translator/IsASTDepthBelowLimit.cpp"
|
||||
"src/compiler/translator/IsASTDepthBelowLimit.h"
|
||||
"src/compiler/translator/Operator.cpp"
|
||||
"src/compiler/translator/Operator.h"
|
||||
"src/compiler/translator/OutputTree.cpp"
|
||||
"src/compiler/translator/OutputTree.h"
|
||||
"src/compiler/translator/ParseContext.cpp"
|
||||
"src/compiler/translator/ParseContext.h"
|
||||
"src/compiler/translator/ParseContext_ESSL_autogen.h"
|
||||
"src/compiler/translator/ParseContext_complete_autogen.h"
|
||||
"src/compiler/translator/ParseContext_interm.h"
|
||||
"src/compiler/translator/PoolAlloc.cpp"
|
||||
"src/compiler/translator/PoolAlloc.h"
|
||||
"src/compiler/translator/Pragma.h"
|
||||
"src/compiler/translator/QualifierTypes.cpp"
|
||||
"src/compiler/translator/QualifierTypes.h"
|
||||
"src/compiler/translator/Severity.h"
|
||||
"src/compiler/translator/ShaderLang.cpp"
|
||||
"src/compiler/translator/ShaderVars.cpp"
|
||||
"src/compiler/translator/StaticType.h"
|
||||
"src/compiler/translator/Symbol.cpp"
|
||||
"src/compiler/translator/Symbol.h"
|
||||
"src/compiler/translator/SymbolTable.cpp"
|
||||
"src/compiler/translator/SymbolTable.h"
|
||||
"src/compiler/translator/SymbolTable_autogen.h"
|
||||
"src/compiler/translator/SymbolUniqueId.cpp"
|
||||
"src/compiler/translator/SymbolUniqueId.h"
|
||||
"src/compiler/translator/TranslatorESSL.h"
|
||||
"src/compiler/translator/TranslatorGLSL.h"
|
||||
"src/compiler/translator/TranslatorHLSL.h"
|
||||
"src/compiler/translator/TranslatorMetal.h"
|
||||
"src/compiler/translator/TranslatorVulkan.h"
|
||||
"src/compiler/translator/Types.cpp"
|
||||
"src/compiler/translator/Types.h"
|
||||
"src/compiler/translator/ValidateAST.cpp"
|
||||
"src/compiler/translator/ValidateAST.h"
|
||||
"src/compiler/translator/ValidateBarrierFunctionCall.cpp"
|
||||
"src/compiler/translator/ValidateBarrierFunctionCall.h"
|
||||
"src/compiler/translator/ValidateClipCullDistance.cpp"
|
||||
"src/compiler/translator/ValidateClipCullDistance.h"
|
||||
"src/compiler/translator/ValidateGlobalInitializer.cpp"
|
||||
"src/compiler/translator/ValidateGlobalInitializer.h"
|
||||
"src/compiler/translator/ValidateLimitations.cpp"
|
||||
"src/compiler/translator/ValidateLimitations.h"
|
||||
"src/compiler/translator/ValidateMaxParameters.cpp"
|
||||
"src/compiler/translator/ValidateMaxParameters.h"
|
||||
"src/compiler/translator/ValidateOutputs.cpp"
|
||||
"src/compiler/translator/ValidateOutputs.h"
|
||||
"src/compiler/translator/ValidateSwitch.cpp"
|
||||
"src/compiler/translator/ValidateSwitch.h"
|
||||
"src/compiler/translator/ValidateVaryingLocations.cpp"
|
||||
"src/compiler/translator/ValidateVaryingLocations.h"
|
||||
"src/compiler/translator/VariablePacker.cpp"
|
||||
"src/compiler/translator/VariablePacker.h"
|
||||
"src/compiler/translator/blocklayout.cpp"
|
||||
"src/compiler/translator/glslang.h"
|
||||
"src/compiler/translator/glslang_lex_autogen.cpp"
|
||||
"src/compiler/translator/glslang_tab_autogen.cpp"
|
||||
"src/compiler/translator/glslang_tab_autogen.h"
|
||||
"src/compiler/translator/glslang_wrapper.h"
|
||||
"src/compiler/translator/length_limits.h"
|
||||
"src/compiler/translator/tree_ops/*.cpp"
|
||||
"src/compiler/translator/tree_ops/*.h"
|
||||
"src/compiler/translator/tree_ops/gl/ClampFragDepth.h"
|
||||
"src/compiler/translator/tree_ops/gl/RegenerateStructNames.h"
|
||||
"src/compiler/translator/tree_ops/gl/RewriteRepeatedAssignToSwizzled.h"
|
||||
"src/compiler/translator/tree_ops/gl/UseInterfaceBlockFields.h"
|
||||
"src/compiler/translator/tree_ops/gl/VectorizeVectorScalarArithmetic.h"
|
||||
"src/compiler/translator/tree_ops/gl/mac/AddAndTrueToLoopCondition.h"
|
||||
"src/compiler/translator/tree_ops/gl/mac/RewriteDoWhile.h"
|
||||
"src/compiler/translator/tree_ops/gl/mac/UnfoldShortCircuitAST.h"
|
||||
"src/compiler/translator/tree_ops/vulkan/EarlyFragmentTestsOptimization.h"
|
||||
"src/compiler/translator/tree_util/*.h"
|
||||
"src/compiler/translator/tree_util/*.cpp"
|
||||
"src/compiler/translator/util.cpp"
|
||||
"src/compiler/translator/util.h"
|
||||
"src/third_party/compiler/ArrayBoundsClamper.cpp"
|
||||
"src/third_party/compiler/ArrayBoundsClamper.h"
|
||||
)
|
||||
list(FILTER TRANSLATOR_SOURCES EXCLUDE REGEX "_unittest")
|
||||
file(GLOB TRANSLATOR_GLSL_BASE_SOURCES
|
||||
"src/compiler/translator/OutputGLSLBase.cpp"
|
||||
"src/compiler/translator/OutputGLSLBase.h"
|
||||
)
|
||||
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
|
||||
"src/compiler/translator/OutputESSL.cpp"
|
||||
"src/compiler/translator/OutputESSL.h"
|
||||
"src/compiler/translator/TranslatorESSL.cpp"
|
||||
"src/compiler/translator/tree_ops/gl/RecordConstantPrecision.cpp"
|
||||
"src/compiler/translator/tree_ops/gl/RecordConstantPrecision.h"
|
||||
)
|
||||
file(GLOB TRANSLATOR_GLSL_SOURCES
|
||||
"src/compiler/translator/BuiltInFunctionEmulatorGLSL.cpp"
|
||||
"src/compiler/translator/BuiltInFunctionEmulatorGLSL.h"
|
||||
"src/compiler/translator/ExtensionGLSL.cpp"
|
||||
"src/compiler/translator/ExtensionGLSL.h"
|
||||
"src/compiler/translator/TranslatorGLSL.cpp"
|
||||
"src/compiler/translator/VersionGLSL.cpp"
|
||||
"src/compiler/translator/VersionGLSL.h"
|
||||
"src/compiler/translator/tree_ops/gl/ClampFragDepth.cpp"
|
||||
"src/compiler/translator/tree_ops/gl/RegenerateStructNames.cpp"
|
||||
"src/compiler/translator/tree_ops/gl/RewriteRepeatedAssignToSwizzled.cpp"
|
||||
"src/compiler/translator/tree_ops/gl/UseInterfaceBlockFields.cpp"
|
||||
"src/compiler/translator/tree_ops/gl/VectorizeVectorScalarArithmetic.cpp"
|
||||
"src/compiler/translator/tree_ops/gl/mac/RewriteRowMajorMatrices.h"
|
||||
"src/compiler/translator/tree_ops/gl/mac/RewriteUnaryMinusOperatorFloat.h"
|
||||
)
|
||||
file(GLOB TRANSLATOR_GLSL_MAC_SOURCES
|
||||
"src/compiler/translator/tree_ops/gl/mac/AddAndTrueToLoopCondition.cpp"
|
||||
"src/compiler/translator/tree_ops/gl/mac/RewriteDoWhile.cpp"
|
||||
"src/compiler/translator/tree_ops/gl/mac/RewriteRowMajorMatrices.cpp"
|
||||
"src/compiler/translator/tree_ops/gl/mac/RewriteUnaryMinusOperatorFloat.cpp"
|
||||
"src/compiler/translator/tree_ops/gl/mac/UnfoldShortCircuitAST.cpp"
|
||||
)
|
||||
file(GLOB TRANSLATOR_HLSL_SOURCES
|
||||
"src/compiler/translator/*HLSL.h"
|
||||
"src/compiler/translator/*HLSL.cpp"
|
||||
"src/compiler/translator/emulated_builtin_functions_hlsl_autogen.cpp"
|
||||
"src/compiler/translator/tree_ops/d3d/*.cpp"
|
||||
"src/compiler/translator/tree_ops/d3d/*.h"
|
||||
)
|
||||
if(ANDROID)
|
||||
list(APPEND TRANSLATOR_SOURCES "src/compiler/translator/ImmutableString_ESSL_autogen.cpp" "src/compiler/translator/SymbolTable_ESSL_autogen.cpp")
|
||||
else()
|
||||
list(APPEND TRANSLATOR_SOURCES "src/compiler/translator/ImmutableString_autogen.cpp" "src/compiler/translator/SymbolTable_autogen.cpp")
|
||||
endif()
|
||||
set(ANGLE_ENABLE_ESSL TRUE)
|
||||
set(ANGLE_ENABLE_GLSL TRUE)
|
||||
set(ANGLE_ENABLE_HLSL TRUE)
|
||||
set(_needs_glsl_base FALSE)
|
||||
set(_needs_glsl_and_vulkan_base FALSE)
|
||||
add_library(angle_translator OBJECT ${TRANSLATOR_SOURCES})
|
||||
if(ANGLE_ENABLE_ESSL)
|
||||
set(_needs_glsl_base TRUE)
|
||||
target_sources(angle_translator PRIVATE ${TRANSLATOR_ESSL_SOURCES})
|
||||
target_compile_definitions(angle_translator PUBLIC -DANGLE_ENABLE_ESSL)
|
||||
endif()
|
||||
if(ANGLE_ENABLE_GLSL)
|
||||
set(_needs_glsl_base TRUE)
|
||||
set(_needs_glsl_and_vulkan_base TRUE)
|
||||
target_sources(angle_translator PRIVATE ${TRANSLATOR_GLSL_SOURCES})
|
||||
if(APPLE)
|
||||
target_sources(angle_translator PRIVATE ${TRANSLATOR_GLSL_MAC_SOURCES})
|
||||
endif()
|
||||
target_compile_definitions(angle_translator PUBLIC -DANGLE_ENABLE_GLSL)
|
||||
endif()
|
||||
if(ANGLE_ENABLE_HLSL)
|
||||
target_sources(angle_translator PRIVATE ${TRANSLATOR_HLSL_SOURCES})
|
||||
target_compile_definitions(angle_translator PUBLIC -DANGLE_ENABLE_HLSL)
|
||||
endif()
|
||||
if(_needs_glsl_base)
|
||||
target_sources(angle_translator PRIVATE ${TRANSLATOR_GLSL_BASE_SOURCES})
|
||||
endif()
|
||||
if(_needs_glsl_and_vulkan_base)
|
||||
target_sources(angle_translator PRIVATE ${TRANSLATOR_GLSL_AND_VULKAN_BASE_SOURCES})
|
||||
endif()
|
||||
target_link_libraries(angle_translator PRIVATE angle::common)
|
||||
add_library(angle::translator ALIAS angle_translator)
|
||||
|
||||
##########
|
||||
# angle::preprocessor
|
||||
file(GLOB PREPROCESSOR_SOURCES
|
||||
"src/compiler/preprocessor/*.h"
|
||||
"src/compiler/preprocessor/*.cpp"
|
||||
)
|
||||
add_library(angle_preprocessor OBJECT ${PREPROCESSOR_SOURCES})
|
||||
target_link_libraries(angle_preprocessor PRIVATE angle::common)
|
||||
add_library(angle::preprocessor ALIAS angle_preprocessor)
|
||||
|
||||
##########
|
||||
# libANGLE
|
||||
|
||||
## OpenGL Renderer
|
||||
if(WINDOWS_DESKTOP OR LINUX OR APPLE)
|
||||
if(WINDOWS_DESKTOP)
|
||||
set(ANGLE_RENDERER_OPENGL_PLATFORM
|
||||
"src/libANGLE/renderer/gl/wgl/*.cpp"
|
||||
"src/libANGLE/renderer/gl/wgl/*.h"
|
||||
)
|
||||
elseif(APPLE)
|
||||
set(ANGLE_RENDERER_OPENGL_PLATFORM
|
||||
"src/libANGLE/renderer/gl/cgl/*.mm"
|
||||
"src/libANGLE/renderer/gl/cgl/*.cpp"
|
||||
"src/libANGLE/renderer/gl/cgl/*.h"
|
||||
"src/libANGLE/renderer/gl/apple/*.mm"
|
||||
"src/libANGLE/renderer/gl/apple/*.cpp"
|
||||
"src/libANGLE/renderer/gl/apple/*.h"
|
||||
"gpu_info_util/SystemInfo_macos.mm"
|
||||
)
|
||||
elseif(LINUX)
|
||||
set(ANGLE_RENDERER_OPENGL_PLATFORM
|
||||
"src/libANGLE/renderer/gl/glx/*.cpp"
|
||||
"src/libANGLE/renderer/gl/glx/*.h"
|
||||
"src/libANGLE/renderer/gl/egl/*.cpp"
|
||||
"src/libANGLE/renderer/gl/egl/*.h"
|
||||
)
|
||||
endif()
|
||||
|
||||
file(GLOB LIBANGLE_GL_SOURCES
|
||||
"src/libANGLE/renderer/gl/*.cpp"
|
||||
"src/libANGLE/renderer/gl/*.inc"
|
||||
"src/libANGLE/renderer/gl/*.h"
|
||||
|
||||
${ANGLE_RENDERER_OPENGL_PLATFORM}
|
||||
)
|
||||
list(FILTER LIBANGLE_GL_SOURCES EXCLUDE REGEX "_unittest")
|
||||
add_library(angle_renderer_opengl INTERFACE)
|
||||
target_sources(angle_renderer_opengl INTERFACE "$<BUILD_INTERFACE:${LIBANGLE_GL_SOURCES}>")
|
||||
target_compile_definitions(angle_renderer_opengl INTERFACE -DANGLE_ENABLE_OPENGL -DANGLE_ENABLE_OPENGL_DESKTOP)
|
||||
add_library(angle::renderer::opengl ALIAS angle_renderer_opengl)
|
||||
endif()
|
||||
|
||||
# D3D Renderers
|
||||
if(WIN32)
|
||||
## All D3D Sources
|
||||
file(GLOB_RECURSE LIBANGLE_D3D_SOURCES
|
||||
"src/libANGLE/renderer/d3d/*.cpp"
|
||||
"src/libANGLE/renderer/d3d/*.inc"
|
||||
"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)
|
||||
set(LIBANGLE_D3D_WINRT_SOURCES ${LIBANGLE_D3D_SOURCES})
|
||||
list(FILTER LIBANGLE_D3D_WINRT_SOURCES INCLUDE REGEX "winrt")
|
||||
add_library(angle_renderer_winrt INTERFACE)
|
||||
target_sources(angle_renderer_winrt INTERFACE "$<BUILD_INTERFACE:${LIBANGLE_D3D_WINRT_SOURCES}>")
|
||||
add_library(angle::renderer::winrt ALIAS angle_renderer_winrt)
|
||||
endif()
|
||||
|
||||
## Win32/d3d9 D3D Renderer
|
||||
if(WINDOWS_DESKTOP)
|
||||
set(LIBANGLE_D3D_DESKTOP_SOURCES ${LIBANGLE_D3D_SOURCES})
|
||||
list(FILTER LIBANGLE_D3D_DESKTOP_SOURCES INCLUDE REGEX "d3d9|win32")
|
||||
find_library(D3D9_LIB NAMES d3d9)
|
||||
add_library(angle_renderer_win32 INTERFACE)
|
||||
target_sources(angle_renderer_win32 INTERFACE "$<BUILD_INTERFACE:${LIBANGLE_D3D_DESKTOP_SOURCES}>")
|
||||
target_compile_definitions(angle_renderer_win32 INTERFACE -DANGLE_ENABLE_D3D9)
|
||||
target_link_libraries(angle_renderer_win32 INTERFACE d3d9)
|
||||
add_library(angle::renderer::win32 ALIAS angle_renderer_win32)
|
||||
endif()
|
||||
|
||||
## D3D11 Base renderer
|
||||
list(FILTER LIBANGLE_D3D_SOURCES EXCLUDE REGEX "winrt|d3d9|win32")
|
||||
find_library(DXGUID_LIB NAMES dxguid)
|
||||
find_library(D3D11_LIB NAMES d3d11)
|
||||
add_library(angle_renderer_d3d INTERFACE)
|
||||
target_sources(angle_renderer_d3d INTERFACE "$<BUILD_INTERFACE:${LIBANGLE_D3D_SOURCES}>")
|
||||
target_compile_definitions(angle_renderer_d3d INTERFACE
|
||||
-DANGLE_ENABLE_D3D11
|
||||
"-DANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ \"d3dcompiler_47.dll\", \"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }"
|
||||
)
|
||||
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()
|
||||
|
||||
## angle::gpu_info_util
|
||||
file(GLOB ANGLE_GPU_INFO_UTIL_SOURCES
|
||||
"src/gpu_info_util/SystemInfo.h"
|
||||
"src/gpu_info_util/SystemInfo_internal.h"
|
||||
"src/gpu_info_util/SystemInfo.cpp"
|
||||
)
|
||||
|
||||
if(LINUX)
|
||||
find_package(X11 COMPONENTS Xext Xi REQUIRED)
|
||||
include_directories(${X11_INCLUDE_DIR})
|
||||
list(APPEND LIBANGLE_RENDERER_PLATFORM ${X11_LIBRARIES})
|
||||
set(LIBANGLE_RENDERER_COMPILEDEF
|
||||
-DANGLE_USE_X11
|
||||
)
|
||||
else()
|
||||
set(LIBANGLE_RENDERER_COMPILEDEF )
|
||||
endif()
|
||||
|
||||
add_library(angle_gpu_info_util OBJECT ${ANGLE_GPU_INFO_UTIL_SOURCES})
|
||||
if(WIN32)
|
||||
target_sources(angle_gpu_info_util PRIVATE "src/gpu_info_util/SystemInfo_win.cpp")
|
||||
target_link_libraries(angle_gpu_info_util PRIVATE setupapi.lib dxgi.lib)
|
||||
elseif(APPLE)
|
||||
target_sources(angle_gpu_info_util PRIVATE "src/gpu_info_util/SystemInfo_apple.mm")
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "Darwin") # macOS
|
||||
target_sources(angle_gpu_info_util PRIVATE "src/gpu_info_util/SystemInfo_macos.mm")
|
||||
endif()
|
||||
find_library(IOKit IOKit)
|
||||
find_library(CoreFoundation CoreFoundation)
|
||||
find_library(CoreGraphics CoreGraphics)
|
||||
target_link_libraries(angle_gpu_info_util PRIVATE ${IOKit} ${CoreFoundation} ${CoreGraphics})
|
||||
elseif(LINUX)
|
||||
target_sources(angle_gpu_info_util PRIVATE "src/gpu_info_util/SystemInfo_linux.cpp" "src/gpu_info_util/SystemInfo_x11.cpp")
|
||||
target_sources(angle_gpu_info_util PRIVATE "src/third_party/libXNVCtrl/NVCtrl.c")
|
||||
target_compile_definitions(angle_gpu_info_util PRIVATE GPU_INFO_USE_X11)
|
||||
target_link_libraries(angle_gpu_info_util PRIVATE X11::X11 X11::Xi X11::Xext)
|
||||
elseif(ANDROID)
|
||||
target_sources(angle_gpu_info_util PRIVATE "src/gpu_info_util/SystemInfo_android.cpp")
|
||||
endif()
|
||||
target_link_libraries(angle_gpu_info_util PRIVATE angle::common)
|
||||
add_library(angle::gpu_info_util ALIAS angle_gpu_info_util)
|
||||
|
||||
## Core libANGLE library
|
||||
if(WIN32)
|
||||
if(NOT WINDOWS_STORE)
|
||||
set(LIBANGLE_SOURCES_PLATFORM
|
||||
"src/third_party/systeminfo/SystemInfo.cpp"
|
||||
)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
file(GLOB LIBANGLE_SOURCES_PLATFORM
|
||||
"src/libANGLE/renderer/*.mm"
|
||||
)
|
||||
else()
|
||||
set(LIBANGLE_SOURCES_PLATFORM)
|
||||
endif()
|
||||
|
||||
file(GLOB LIBANGLE_SOURCES
|
||||
"src/common/third_party/murmurhash/MurmurHash3.cpp"
|
||||
"src/common/event_tracer.cpp"
|
||||
|
||||
"src/libANGLE/*.cpp"
|
||||
"src/libANGLE/*.inc"
|
||||
"src/libANGLE/*.h"
|
||||
|
||||
"src/libANGLE/renderer/*.cpp"
|
||||
"src/libANGLE/renderer/*.h"
|
||||
|
||||
"src/libANGLE/renderer/null/*.cpp"
|
||||
"src/libANGLE/renderer/null/*.h"
|
||||
|
||||
# The frame capture headers are always visible to libANGLE.
|
||||
"src/libANGLE/capture/*.h"
|
||||
|
||||
# angle_frame_capture_disabled
|
||||
"src/libANGLE/capture/FrameCapture_mock.cpp"
|
||||
"src/libANGLE/capture/frame_capture_utils_mock.cpp"
|
||||
|
||||
# angle_gl_enum_utils
|
||||
"src/libANGLE/capture/gl_enum_utils.cpp"
|
||||
"src/libANGLE/capture/gl_enum_utils_autogen.cpp"
|
||||
|
||||
${LIBANGLE_SOURCES_PLATFORM}
|
||||
)
|
||||
list(FILTER LIBANGLE_SOURCES EXCLUDE REGEX "_unittest|glslang_wrapper|dxgi_|d3d_format")
|
||||
if(WIN32)
|
||||
set(LIBANGLE_D3D_FORMAT_TABLES_SOURCES_PLATFORM)
|
||||
if(NOT WINDOWS_STORE)
|
||||
list(APPEND LIBANGLE_D3D_FORMAT_TABLES_SOURCES_PLATFORM
|
||||
"src/libANGLE/renderer/d3d_format.cpp"
|
||||
"src/libANGLE/renderer/d3d_format.h"
|
||||
)
|
||||
endif()
|
||||
file(GLOB LIBANGLE_D3D_FORMAT_TABLES_SOURCES
|
||||
"src/libANGLE/renderer/dxgi_format_map.h"
|
||||
"src/libANGLE/renderer/dxgi_format_map_autogen.cpp"
|
||||
"src/libANGLE/renderer/dxgi_support_table.h"
|
||||
"src/libANGLE/renderer/dxgi_support_table_autogen.cpp"
|
||||
|
||||
${LIBANGLE_D3D_FORMAT_TABLES_SOURCES_PLATFORM}
|
||||
)
|
||||
list(APPEND LIBANGLE_SOURCES "${LIBANGLE_D3D_FORMAT_TABLES_SOURCES}")
|
||||
endif()
|
||||
|
||||
if(LINUX OR APPLE)
|
||||
set(LIBANGLE_RENDERER_PLATFORM
|
||||
angle::renderer::opengl
|
||||
)
|
||||
elseif(WINDOWS_STORE)
|
||||
set(LIBANGLE_RENDERER_PLATFORM
|
||||
angle::renderer::d3d
|
||||
angle::renderer::winrt
|
||||
)
|
||||
elseif(WINDOWS_DESKTOP)
|
||||
set(LIBANGLE_RENDERER_PLATFORM
|
||||
angle::renderer::d3d
|
||||
angle::renderer::win32
|
||||
angle::renderer::opengl
|
||||
gdi32
|
||||
)
|
||||
else()
|
||||
set(LIBANGLE_RENDERER_PLATFORM )
|
||||
endif()
|
||||
|
||||
add_library(libANGLE STATIC ${LIBANGLE_SOURCES})
|
||||
target_link_libraries(libANGLE PRIVATE
|
||||
angle::common
|
||||
angle::compression
|
||||
angle::image_util
|
||||
angle::gpu_info_util
|
||||
angle::translator
|
||||
angle::preprocessor
|
||||
${LIBANGLE_RENDERER_PLATFORM}
|
||||
)
|
||||
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}
|
||||
-DANGLE_EXPORT=
|
||||
-DANGLE_UTIL_EXPORT=
|
||||
-DEGLAPI=
|
||||
-DGL_APICALL=
|
||||
-DGL_API=
|
||||
-DANGLE_CAPTURE_ENABLED=0
|
||||
)
|
||||
add_library(angle::libANGLE ALIAS libANGLE)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(libANGLE
|
||||
PRIVATE -DLIBANGLE_UTIL_IMPLEMENTATION
|
||||
)
|
||||
endif()
|
||||
|
||||
##########
|
||||
# libGLESv2
|
||||
# Modified according to the file src/libGLESv2.gni
|
||||
list(APPEND LIBGLESV2_SOURCES
|
||||
"src/libGLESv2/egl_ext_stubs.cpp"
|
||||
"src/libGLESv2/egl_ext_stubs_autogen.h"
|
||||
"src/libGLESv2/egl_stubs.cpp"
|
||||
"src/libGLESv2/egl_stubs_autogen.h"
|
||||
"src/libGLESv2/entry_points_egl_autogen.cpp"
|
||||
"src/libGLESv2/entry_points_egl_autogen.h"
|
||||
"src/libGLESv2/entry_points_egl_ext_autogen.cpp"
|
||||
"src/libGLESv2/entry_points_egl_ext_autogen.h"
|
||||
"src/libGLESv2/entry_points_gles_1_0_autogen.cpp"
|
||||
"src/libGLESv2/entry_points_gles_1_0_autogen.h"
|
||||
"src/libGLESv2/entry_points_gles_2_0_autogen.cpp"
|
||||
"src/libGLESv2/entry_points_gles_2_0_autogen.h"
|
||||
"src/libGLESv2/entry_points_gles_3_0_autogen.cpp"
|
||||
"src/libGLESv2/entry_points_gles_3_0_autogen.h"
|
||||
"src/libGLESv2/entry_points_gles_3_1_autogen.cpp"
|
||||
"src/libGLESv2/entry_points_gles_3_1_autogen.h"
|
||||
"src/libGLESv2/entry_points_gles_3_2_autogen.cpp"
|
||||
"src/libGLESv2/entry_points_gles_3_2_autogen.h"
|
||||
"src/libGLESv2/entry_points_gles_ext_autogen.cpp"
|
||||
"src/libGLESv2/entry_points_gles_ext_autogen.h"
|
||||
"src/libGLESv2/global_state.cpp"
|
||||
"src/libGLESv2/global_state.h"
|
||||
"src/libGLESv2/libGLESv2_autogen.cpp"
|
||||
"src/libGLESv2/proc_table_egl.h"
|
||||
"src/libGLESv2/proc_table_egl_autogen.cpp"
|
||||
"src/libGLESv2/resource.h"
|
||||
"src/libGLESv2/libGLESv2_autogen.def"
|
||||
)
|
||||
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
|
||||
"-DGL_GLES_PROTOTYPES=1"
|
||||
"-DGL_GLEXT_PROTOTYPES"
|
||||
"-DEGL_EGL_PROTOTYPES=1"
|
||||
"-DEGL_EGLEXT_PROTOTYPES"
|
||||
)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
else()
|
||||
if(WIN32)
|
||||
target_compile_definitions(libGLESv2 PRIVATE
|
||||
"-DGL_API="
|
||||
"-DGL_APICALL="
|
||||
"-DEGLAPI="
|
||||
)
|
||||
else()
|
||||
target_compile_definitions(libGLESv2 PRIVATE
|
||||
"-DGL_API=__attribute__((visibility(\"default\")))"
|
||||
"-DGL_APICALL=__attribute__((visibility(\"default\")))"
|
||||
"-DEGLAPI=__attribute__((visibility(\"default\")))"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_include_directories(libGLESv2 PUBLIC "$<INSTALL_INTERFACE:include>")
|
||||
|
||||
##########
|
||||
# libEGL
|
||||
if(WIN32)
|
||||
set(libEGL_def
|
||||
"src/libEGL/libEGL_autogen.def"
|
||||
)
|
||||
endif()
|
||||
add_library(libEGL
|
||||
"src/libEGL/egl_loader_autogen.h"
|
||||
"src/libEGL/libEGL_autogen.cpp"
|
||||
"src/libEGL/resource.h"
|
||||
"src/libGLESv2/entry_points_egl_autogen.h"
|
||||
"src/libGLESv2/entry_points_egl_ext_autogen.h"
|
||||
${libEGL_def}
|
||||
)
|
||||
|
||||
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
|
||||
"-DLIBEGL_IMPLEMENTATION"
|
||||
PUBLIC
|
||||
"-DGL_GLES_PROTOTYPES=1"
|
||||
"-DGL_GLEXT_PROTOTYPES"
|
||||
"-DEGL_EGL_PROTOTYPES=1"
|
||||
"-DEGL_EGLEXT_PROTOTYPES"
|
||||
)
|
||||
add_library(GL_VISIBILITY INTERFACE)
|
||||
if(WIN32)
|
||||
target_compile_definitions(GL_VISIBILITY INTERFACE
|
||||
"-DGL_API="
|
||||
"-DGL_APICALL=")
|
||||
else()
|
||||
target_compile_definitions(GL_VISIBILITY INTERFACE
|
||||
"-DGL_API=__attribute__((visibility(\"default\")))"
|
||||
"-DGL_APICALL=__attribute__((visibility(\"default\")))")
|
||||
endif()
|
||||
target_link_libraries(libEGL PRIVATE GL_VISIBILITY)
|
||||
target_link_libraries(libGLESv2 PRIVATE GL_VISIBILITY)
|
||||
|
||||
if(WIN32)
|
||||
target_compile_definitions(libEGL PRIVATE
|
||||
"-DEGLAPI="
|
||||
)
|
||||
else()
|
||||
target_compile_definitions(libEGL PRIVATE
|
||||
"-DEGLAPI=__attribute__((visibility(\"default\")))"
|
||||
)
|
||||
endif()
|
||||
|
||||
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 "" 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
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
|
||||
if(WINDOWS_DESKTOP)
|
||||
install(TARGETS angle_renderer_d3d angle_renderer_win32 angle_renderer_opengl EXPORT ANGLEExport
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
elseif(WINDOWS_STORE)
|
||||
install(TARGETS angle_renderer_d3d angle_renderer_winrt EXPORT ANGLEExport
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
else()
|
||||
install(TARGETS angle_renderer_opengl EXPORT ANGLEExport
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
endif()
|
||||
|
||||
install(EXPORT ANGLEExport FILE unofficial-angle-targets.cmake NAMESPACE unofficial::angle:: DESTINATION share/unofficial-angle)
|
||||
install(FILES unofficial-angle-config.cmake DESTINATION share/unofficial-angle)
|
||||
|
||||
if(NOT DISABLE_INSTALL_HEADERS)
|
||||
install(
|
||||
DIRECTORY include/
|
||||
DESTINATION include
|
||||
FILES_MATCHING
|
||||
PATTERN "*.h"
|
||||
PATTERN "*.inc"
|
||||
PATTERN "CL" EXCLUDE
|
||||
PATTERN "GLSLANG" EXCLUDE
|
||||
PATTERN "egl.h" EXCLUDE
|
||||
PATTERN "eglext.h" EXCLUDE
|
||||
PATTERN "eglplatform.h" EXCLUDE
|
||||
PATTERN "KHR" EXCLUDE
|
||||
PATTERN "WGL" EXCLUDE
|
||||
PATTERN "export.h" EXCLUDE
|
||||
)
|
||||
endif()
|
@ -1,3 +0,0 @@
|
||||
#define ANGLE_COMMIT_HASH "invalid-hash"
|
||||
#define ANGLE_COMMIT_HASH_SIZE 12
|
||||
#define ANGLE_COMMIT_DATE "invalid-date"
|
4
ports/angle/angle_commit.h.in
Normal file
4
ports/angle/angle_commit.h.in
Normal file
@ -0,0 +1,4 @@
|
||||
#cmakedefine ANGLE_COMMIT_HASH "@ANGLE_COMMIT_HASH@"
|
||||
#cmakedefine ANGLE_COMMIT_HASH_SIZE @ANGLE_COMMIT_HASH_SIZE@
|
||||
#cmakedefine ANGLE_COMMIT_DATE "@ANGLE_COMMIT_DATE@"
|
||||
#cmakedefine ANGLE_REVISION @ANGLE_REVISION@
|
434
ports/angle/cmake-buildsystem/CMakeLists.txt
Normal file
434
ports/angle/cmake-buildsystem/CMakeLists.txt
Normal file
@ -0,0 +1,434 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(angle CXX C)
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
include(WebKitCommon-minimal)
|
||||
|
||||
set(ANGLE_FRAMEWORK_HEADERS_DIR "${CMAKE_BINARY_DIR}/ANGLE/headers")
|
||||
|
||||
set(USE_ANGLE_EGL ON)
|
||||
if (NOT WINDOWS_STORE)
|
||||
set(USE_OPENGL ON)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options(/d2guard4 /Wv:18 /guard:cf /permissive /bigobj)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
|
||||
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|
||||
if(WIN32)
|
||||
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
||||
endif()
|
||||
|
||||
if (WINDOWS_STORE)
|
||||
set(WINRT_DEFINES -DANGLE_ENABLE_WINDOWS_UWP -DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP)
|
||||
else()
|
||||
set(WINRT_DEFINES)
|
||||
endif()
|
||||
add_definitions(
|
||||
-D_CRT_SECURE_NO_DEPRECATE
|
||||
-D_SCL_SECURE_NO_WARNINGS
|
||||
-DGL_SILENCE_DEPRECATION
|
||||
-D_HAS_EXCEPTIONS=0
|
||||
-DNOMINMAX
|
||||
-DANGLE_STANDALONE_BUILD
|
||||
${WINRT_DEFINES}
|
||||
)
|
||||
add_compile_options("$<$<CONFIG:DEBUG>:-DANGLE_ENABLE_DEBUG_ANNOTATIONS>")
|
||||
if(WIN32)
|
||||
add_definitions(-DANGLE_IS_WIN)
|
||||
endif()
|
||||
if(LINUX)
|
||||
add_definitions(-DANGLE_IS_LINUX)
|
||||
endif()
|
||||
if(ANGLE_IS_64_BIT_CPU)
|
||||
add_definitions(-DANGLE_IS_64_BIT_CPU)
|
||||
elseif(ANGLE_IS_32_BIT_CPU)
|
||||
add_definitions(-DANGLE_IS_32_BIT_CPU)
|
||||
endif()
|
||||
if(ANGLE_USE_D3D11_COMPOSITOR_NATIVE_WINDOW)
|
||||
if(NOT WIN32)
|
||||
message(FATAL_ERROR "ANGLE_USE_D3D11_COMPOSITOR_NATIVE_WINDOW is set, but is only supported on Windows")
|
||||
endif()
|
||||
set(angle_enable_d3d11_compositor_native_window TRUE)
|
||||
endif()
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
|
||||
##################################################
|
||||
|
||||
# Derived from: https://github.com/WebKit/WebKit/blob/92dbcacf4c3e3a8fc6eea68e7022ca59401749e0/Source/ThirdParty/ANGLE/CMakeLists.txt
|
||||
# With modifications for vcpkg port (marked with "VCPKG EDIT:" comments)
|
||||
|
||||
set_property(DIRECTORY . PROPERTY FOLDER "ANGLE")
|
||||
|
||||
# VCPKG EDIT: modified block
|
||||
if (APPLE)
|
||||
set(is_apple TRUE)
|
||||
if (IOS)
|
||||
set(is_ios TRUE)
|
||||
if (USE_OPENGL)
|
||||
set(angle_enable_eagl TRUE)
|
||||
endif()
|
||||
else()
|
||||
set(is_mac TRUE)
|
||||
endif()
|
||||
if (USE_OPENGL AND NOT angle_enable_eagl)
|
||||
set(angle_enable_cgl TRUE)
|
||||
endif()
|
||||
elseif (WIN32)
|
||||
set(is_win TRUE)
|
||||
if (NOT WINDOWS_STORE)
|
||||
set(angle_is_winuwp FALSE)
|
||||
else()
|
||||
set(angle_is_winuwp TRUE)
|
||||
set(target_os "winuwp")
|
||||
endif()
|
||||
if (NOT angle_is_winuwp)
|
||||
set(angle_enable_d3d9 TRUE)
|
||||
endif()
|
||||
set(angle_enable_d3d11 TRUE)
|
||||
elseif (UNIX)
|
||||
set(is_linux TRUE)
|
||||
if(LINUX)
|
||||
set(angle_use_x11 TRUE)
|
||||
endif()
|
||||
endif ()
|
||||
# VCPKG EDIT: end vcpkg modified block
|
||||
|
||||
include(Compiler.cmake)
|
||||
include(GLESv2.cmake)
|
||||
|
||||
# ANGLE Renderer backends
|
||||
include(D3D.cmake)
|
||||
include(GL.cmake)
|
||||
include(Metal.cmake)
|
||||
|
||||
set(no_gl_prototypes
|
||||
GL_GLES_PROTOTYPES=0
|
||||
EGL_EGL_PROTOTYPES=0
|
||||
)
|
||||
|
||||
set(gl_prototypes
|
||||
GL_GLES_PROTOTYPES=1
|
||||
EGL_EGL_PROTOTYPES=1
|
||||
GL_GLEXT_PROTOTYPES
|
||||
EGL_EGLEXT_PROTOTYPES
|
||||
)
|
||||
|
||||
# Default library types for ANGLE
|
||||
# Override these in Platform*.cmake for your port as needed.
|
||||
set(ANGLE_LIBRARY_TYPE STATIC) # libANGLE static library (matches expected behavior & prior behavior)
|
||||
set(GLESv2_LIBRARY_TYPE) # VCPKG EDIT: Default to BUILD_SHARED_LIBS setting
|
||||
set(EGL_LIBRARY_TYPE) # VCPKG EDIT: Default to BUILD_SHARED_LIBS setting
|
||||
|
||||
# ANGLE makes a number of small static libraries that are then joined into a
|
||||
# bigger library that is built shared. Rather than making the small libraries
|
||||
# there will be a ANGLE whose sources are dependent on whether the library
|
||||
# is being used as a compiler or as a GLES implementation.
|
||||
#
|
||||
# The corresponding gn targets are described below
|
||||
#
|
||||
# ANGLE (Compiler only)
|
||||
# + angle_common
|
||||
# + preprocessor
|
||||
# + translator
|
||||
#
|
||||
# ANGLE (GLES)
|
||||
# + ANGLE (Compiler only)
|
||||
# + xxhash
|
||||
# + angle_image_util
|
||||
# + angle_system_utils (OS specific)
|
||||
# + angle_(renderer) (Backend and OS specific)
|
||||
|
||||
set(ANGLE_PRIVATE_INCLUDE_DIRECTORIES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/KHR"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/common/third_party/base"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/common/base"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/common/third_party/xxhash"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/zlib/google"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/include"
|
||||
)
|
||||
|
||||
set(ANGLE_DEFINITIONS
|
||||
ANGLE_ENABLE_ESSL
|
||||
ANGLE_ENABLE_GLSL
|
||||
)
|
||||
|
||||
# VCPKG EDIT
|
||||
list(APPEND ANGLE_DEFINITIONS ANGLE_CAPTURE_ENABLED=0)
|
||||
if (NOT WIN32)
|
||||
list(APPEND ANGLE_DEFINITIONS
|
||||
"-DGL_API=__attribute__((visibility(\"default\")))"
|
||||
"-DGL_APICALL=__attribute__((visibility(\"default\")))"
|
||||
)
|
||||
endif()
|
||||
# END VCPKG EDIT
|
||||
|
||||
set(ANGLE_SOURCES
|
||||
${libangle_common_sources}
|
||||
${libangle_common_shader_state_sources}
|
||||
${angle_preprocessor_sources}
|
||||
${angle_translator_glsl_base_sources}
|
||||
${angle_translator_essl_sources}
|
||||
${angle_translator_essl_symbol_table_sources}
|
||||
${angle_translator_glsl_and_vulkan_base_sources}
|
||||
${angle_translator_glsl_sources}
|
||||
${angle_translator_sources}
|
||||
${angle_system_utils_sources}
|
||||
src/common/angle_version_info.cpp
|
||||
src/libANGLE/capture/FrameCapture_mock.cpp
|
||||
src/libANGLE/capture/serialize_mock.cpp
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
# FIXME: DX11 support will not compile if this preprocessor definition is set
|
||||
# DirectX Documentation is setting that version to 0x700 but there is no
|
||||
# corresponding value in sdkddkver.h
|
||||
remove_definitions(-D_WIN32_WINNT=0x601 -DWINVER=0x601)
|
||||
|
||||
list(APPEND ANGLE_SOURCES
|
||||
"src/libANGLE/renderer/dxgi_format_map.h"
|
||||
"src/libANGLE/renderer/dxgi_format_map_autogen.cpp"
|
||||
"src/libANGLE/renderer/dxgi_support_table.h"
|
||||
"src/libANGLE/renderer/dxgi_support_table_autogen.cpp"
|
||||
)
|
||||
if (NOT angle_is_winuwp)
|
||||
list(APPEND ANGLE_SOURCES
|
||||
"src/libANGLE/renderer/d3d_format.cpp"
|
||||
"src/libANGLE/renderer/d3d_format.h"
|
||||
)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
set(ANGLEGLESv2_LIBRARIES
|
||||
ANGLE
|
||||
)
|
||||
|
||||
set(zlib_wrapper_sources
|
||||
"third_party/zlib/google/compression_utils_portable.h"
|
||||
"third_party/zlib/google/compression_utils_portable.cc"
|
||||
)
|
||||
|
||||
set(angle_gl_enum_utils # VCPKG EDIT: Update paths
|
||||
"src/common/gl_enum_utils.cpp"
|
||||
"src/common/gl_enum_utils.h"
|
||||
"src/common/gl_enum_utils_autogen.cpp"
|
||||
"src/common/gl_enum_utils_autogen.h"
|
||||
)
|
||||
|
||||
set(angle_glslang_wrapper
|
||||
"src/libANGLE/renderer/ShaderInterfaceVariableInfoMap.cpp"
|
||||
"src/libANGLE/renderer/ShaderInterfaceVariableInfoMap.h"
|
||||
"src/libANGLE/renderer/glslang_wrapper_utils.cpp"
|
||||
"src/libANGLE/renderer/glslang_wrapper_utils.h"
|
||||
)
|
||||
|
||||
WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
|
||||
|
||||
add_subdirectory(include)
|
||||
|
||||
add_library(ANGLEFramework INTERFACE)
|
||||
add_dependencies(ANGLEFramework GLSLANGHeaders ANGLEHeaders)
|
||||
|
||||
if (USE_ANGLE_EGL OR ENABLE_WEBGL)
|
||||
add_library(ANGLE ${ANGLE_LIBRARY_TYPE}
|
||||
${ANGLE_SOURCES}
|
||||
${libangle_sources}
|
||||
${libangle_headers}
|
||||
${libangle_image_util_sources}
|
||||
${libangle_image_util_headers}
|
||||
${xxhash_sources}
|
||||
${zlib_wrapper_sources}
|
||||
${angle_gl_enum_utils}
|
||||
)
|
||||
target_include_directories(ANGLE PRIVATE ${ANGLE_PRIVATE_INCLUDE_DIRECTORIES})
|
||||
target_compile_definitions(ANGLE PRIVATE
|
||||
${no_gl_prototypes}
|
||||
LIBANGLE_IMPLEMENTATION
|
||||
)
|
||||
target_compile_definitions(ANGLE PUBLIC ${ANGLE_DEFINITIONS})
|
||||
target_link_libraries(ANGLE PRIVATE ZLIB::ZLIB ${CMAKE_DL_LIBS})
|
||||
|
||||
target_compile_definitions(ANGLEFramework INTERFACE ${gl_prototypes})
|
||||
|
||||
add_library(GLESv2 ${GLESv2_LIBRARY_TYPE}
|
||||
${libglesv2_sources}
|
||||
)
|
||||
target_include_directories(GLESv2 PRIVATE ${ANGLE_PRIVATE_INCLUDE_DIRECTORIES})
|
||||
target_compile_definitions(GLESv2 PRIVATE
|
||||
${no_gl_prototypes}
|
||||
LIBGLESV2_IMPLEMENTATION
|
||||
)
|
||||
|
||||
target_link_libraries(GLESv2 PRIVATE ${ANGLEGLESv2_LIBRARIES} ${CMAKE_DL_LIBS})
|
||||
|
||||
if (WIN32)
|
||||
# Output library name according to the .def
|
||||
target_sources(GLESv2 PRIVATE src/libGLESv2/libGLESv2_autogen.def)
|
||||
set_target_properties(GLESv2 PROPERTIES OUTPUT_NAME libGLESv2)
|
||||
endif ()
|
||||
# Rename libs to avoid conflict with system OpenGL
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
set_target_properties(GLESv2 PROPERTIES OUTPUT_NAME libGLESv2_angle)
|
||||
endif()
|
||||
|
||||
add_library(GLESv2Framework INTERFACE)
|
||||
target_link_libraries(GLESv2Framework INTERFACE GLESv2)
|
||||
target_include_directories(GLESv2Framework INTERFACE ${ANGLE_FRAMEWORK_HEADERS_DIR})
|
||||
target_compile_definitions(GLESv2Framework INTERFACE USE_SYSTEM_EGL)
|
||||
add_library(ANGLE::GLES ALIAS GLESv2Framework)
|
||||
|
||||
if (USE_ANGLE_EGL)
|
||||
add_library(EGL ${EGL_LIBRARY_TYPE}
|
||||
${libegl_sources}
|
||||
)
|
||||
target_include_directories(EGL PRIVATE ${ANGLE_PRIVATE_INCLUDE_DIRECTORIES})
|
||||
target_compile_definitions(EGL PRIVATE
|
||||
${ANGLE_DEFINITIONS}
|
||||
${gl_prototypes}
|
||||
EGLAPI=
|
||||
)
|
||||
|
||||
target_link_libraries(EGL PRIVATE GLESv2 ${CMAKE_DL_LIBS})
|
||||
|
||||
set_target_properties(EGL PROPERTIES LINKER_LANGUAGE CXX)
|
||||
if (WIN32)
|
||||
# Output library names according to the .def
|
||||
target_sources(EGL PRIVATE src/libEGL/libEGL_autogen.def)
|
||||
set_target_properties(EGL PROPERTIES OUTPUT_NAME libEGL)
|
||||
endif ()
|
||||
# Rename libs to avoid conflict with system OpenGL
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
set_target_properties(EGL PROPERTIES OUTPUT_NAME libEGL_angle)
|
||||
endif()
|
||||
|
||||
add_library(EGLFramework INTERFACE)
|
||||
target_include_directories(EGLFramework INTERFACE ${ANGLE_FRAMEWORK_HEADERS_DIR}/)
|
||||
target_compile_definitions(EGLFramework INTERFACE ${gl_prototypes})
|
||||
target_link_libraries(EGLFramework INTERFACE EGL)
|
||||
add_library(ANGLE::EGL ALIAS EGLFramework)
|
||||
endif ()
|
||||
else ()
|
||||
add_library(ANGLE ${ANGLE_LIBRARY_TYPE} ${ANGLE_SOURCES})
|
||||
target_include_directories(ANGLE PRIVATE ${ANGLE_PRIVATE_INCLUDE_DIRECTORIES})
|
||||
target_link_libraries(ANGLE PRIVATE ${CMAKE_DL_LIBS})
|
||||
target_compile_definitions(ANGLE PRIVATE
|
||||
${ANGLE_DEFINITIONS}
|
||||
${no_gl_prototypes}
|
||||
LIBANGLE_IMPLEMENTATION
|
||||
)
|
||||
endif ()
|
||||
|
||||
if (ENABLE_WEBGL)
|
||||
set(libglesv2_entry_points_headers
|
||||
src/libGLESv2/entry_points_egl_autogen.h
|
||||
src/libGLESv2/entry_points_egl_ext_autogen.h
|
||||
src/libGLESv2/entry_points_gles_2_0_autogen.h
|
||||
src/libGLESv2/entry_points_gles_3_0_autogen.h
|
||||
src/libGLESv2/entry_points_gles_ext_autogen.h
|
||||
)
|
||||
|
||||
WEBKIT_COPY_FILES(LibGLESv2EntryPointsHeaders
|
||||
DESTINATION ${ANGLE_FRAMEWORK_HEADERS_DIR}/ANGLE
|
||||
FILES ${libglesv2_entry_points_headers}
|
||||
FLATTENED
|
||||
)
|
||||
if (WIN32 AND TARGET GLESv2)
|
||||
# GLESv2 needs to have a direct or indirect dependency to
|
||||
# LibGLESv2EntryPointsHeaders for CMake Visual Studio generator
|
||||
# to eliminate duplicated custom commands. Otherwise,
|
||||
# entry_points_*.h will be copied twice in both projects.
|
||||
add_dependencies(GLESv2 LibGLESv2EntryPointsHeaders)
|
||||
endif ()
|
||||
|
||||
add_custom_target(ANGLE-webgl-headers
|
||||
DEPENDS LibGLESv2EntryPointsHeaders ANGLEWebGLHeaders
|
||||
COMMAND ${CMAKE_COMMAND} -E env
|
||||
BUILT_PRODUCTS_DIR=${ANGLE_FRAMEWORK_HEADERS_DIR}
|
||||
PUBLIC_HEADERS_FOLDER_PATH=/ANGLE
|
||||
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/adjust-angle-include-paths.py
|
||||
VERBATIM
|
||||
)
|
||||
add_dependencies(GLESv2Framework ANGLE-webgl-headers)
|
||||
endif ()
|
||||
|
||||
if (COMPILER_IS_GCC_OR_CLANG)
|
||||
foreach (angle_target ANGLE EGL GLESv2)
|
||||
if (TARGET ${angle_target})
|
||||
WEBKIT_ADD_TARGET_C_FLAGS(${angle_target} -w)
|
||||
WEBKIT_ADD_TARGET_CXX_FLAGS(${angle_target} -w)
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
|
||||
target_link_libraries(ANGLEFramework INTERFACE ANGLE)
|
||||
target_include_directories(ANGLEFramework INTERFACE ${ANGLE_FRAMEWORK_HEADERS_DIR})
|
||||
|
||||
add_library(ANGLE::ANGLE ALIAS ANGLEFramework)
|
||||
|
||||
|
||||
##################################################
|
||||
|
||||
#### VCPKG EDIT:
|
||||
#### various vcpkg additions and install commands
|
||||
|
||||
# X11 support
|
||||
if (angle_use_x11)
|
||||
find_package(X11 COMPONENTS Xext Xi REQUIRED)
|
||||
target_include_directories(ANGLE PRIVATE ${X11_INCLUDE_DIR})
|
||||
target_sources(ANGLE PRIVATE ${libangle_gpu_info_util_x11_sources})
|
||||
target_sources(ANGLE PRIVATE "src/gpu_info_util/SystemInfo_x11.cpp")
|
||||
target_compile_definitions(ANGLE PRIVATE ANGLE_USE_X11 GPU_INFO_USE_X11)
|
||||
target_link_libraries(ANGLE PRIVATE $X11_LIBRARIES} X11::X11 X11::Xi X11::Xext)
|
||||
endif()
|
||||
|
||||
# set export names of some targets to match prior vcpkg port buildsystem
|
||||
if(TARGET EGL)
|
||||
set_target_properties(EGL PROPERTIES EXPORT_NAME libEGL)
|
||||
endif()
|
||||
if(TARGET GLESv2)
|
||||
set_target_properties(GLESv2 PROPERTIES EXPORT_NAME libGLESv2)
|
||||
endif()
|
||||
set_target_properties(ANGLE PROPERTIES EXPORT_NAME libANGLE)
|
||||
|
||||
set(_possibleTargets EGL GLESv2 ANGLE)
|
||||
foreach(_target IN LISTS _possibleTargets)
|
||||
if(TARGET ${_target})
|
||||
list(APPEND _installableTargets "${_target}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
install(TARGETS ${_installableTargets} EXPORT ANGLEExport
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
|
||||
install(EXPORT ANGLEExport FILE unofficial-angle-targets.cmake NAMESPACE unofficial::angle:: DESTINATION share/unofficial-angle)
|
||||
install(FILES unofficial-angle-config.cmake DESTINATION share/unofficial-angle)
|
||||
|
||||
if(NOT DISABLE_INSTALL_HEADERS)
|
||||
install(
|
||||
DIRECTORY "${ANGLE_FRAMEWORK_HEADERS_DIR}"
|
||||
DESTINATION include
|
||||
FILES_MATCHING
|
||||
PATTERN "*.h"
|
||||
PATTERN "*.inc"
|
||||
PATTERN "CL" EXCLUDE
|
||||
PATTERN "GLSLANG" EXCLUDE
|
||||
PATTERN "egl.h" EXCLUDE
|
||||
PATTERN "eglext.h" EXCLUDE
|
||||
PATTERN "eglplatform.h" EXCLUDE
|
||||
PATTERN "KHR" EXCLUDE
|
||||
PATTERN "WGL" EXCLUDE
|
||||
PATTERN "export.h" EXCLUDE
|
||||
)
|
||||
endif()
|
30
ports/angle/cmake-buildsystem/PlatformLinux.cmake
Normal file
30
ports/angle/cmake-buildsystem/PlatformLinux.cmake
Normal file
@ -0,0 +1,30 @@
|
||||
list(APPEND ANGLE_DEFINITIONS ANGLE_PLATFORM_LINUX USE_SYSTEM_EGL)
|
||||
include(linux.cmake)
|
||||
|
||||
if (USE_OPENGL)
|
||||
# Enable GLSL compiler output.
|
||||
list(APPEND ANGLE_DEFINITIONS ANGLE_ENABLE_GLSL)
|
||||
endif ()
|
||||
|
||||
if (USE_ANGLE_EGL OR ENABLE_WEBGL)
|
||||
list(APPEND ANGLE_SOURCES
|
||||
${_gl_backend_sources}
|
||||
|
||||
${angle_system_utils_sources_linux}
|
||||
${angle_system_utils_sources_posix}
|
||||
|
||||
${angle_dma_buf_sources}
|
||||
|
||||
${libangle_gl_egl_dl_sources}
|
||||
${libangle_gl_egl_sources}
|
||||
${libangle_gl_sources}
|
||||
|
||||
${libangle_gpu_info_util_sources}
|
||||
${libangle_gpu_info_util_linux_sources}
|
||||
)
|
||||
|
||||
list(APPEND ANGLE_DEFINITIONS
|
||||
ANGLE_ENABLE_OPENGL
|
||||
)
|
||||
|
||||
endif ()
|
60
ports/angle/cmake-buildsystem/PlatformMac.cmake
Normal file
60
ports/angle/cmake-buildsystem/PlatformMac.cmake
Normal file
@ -0,0 +1,60 @@
|
||||
find_library(COREGRAPHICS_LIBRARY CoreGraphics)
|
||||
find_library(FOUNDATION_LIBRARY Foundation)
|
||||
find_library(IOKIT_LIBRARY IOKit)
|
||||
find_library(IOSURFACE_LIBRARY IOSurface)
|
||||
find_library(QUARTZ_LIBRARY Quartz)
|
||||
find_package(ZLIB REQUIRED)
|
||||
|
||||
list(APPEND ANGLE_SOURCES
|
||||
${libangle_gpu_info_util_mac_sources}
|
||||
${libangle_gpu_info_util_sources}
|
||||
${libangle_mac_sources}
|
||||
)
|
||||
|
||||
list(APPEND ANGLEGLESv2_LIBRARIES
|
||||
${COREGRAPHICS_LIBRARY}
|
||||
${FOUNDATION_LIBRARY}
|
||||
${IOKIT_LIBRARY}
|
||||
${IOSURFACE_LIBRARY}
|
||||
${QUARTZ_LIBRARY}
|
||||
)
|
||||
|
||||
# Metal backend
|
||||
if(USE_METAL)
|
||||
find_library(METAL_LIBRARY Metal)
|
||||
list(APPEND ANGLE_SOURCES
|
||||
${_metal_backend_sources}
|
||||
|
||||
${angle_translator_lib_metal_sources}
|
||||
|
||||
${angle_glslang_wrapper}
|
||||
)
|
||||
|
||||
list(APPEND ANGLE_DEFINITIONS
|
||||
ANGLE_ENABLE_METAL
|
||||
)
|
||||
|
||||
list(APPEND ANGLEGLESv2_LIBRARIES
|
||||
${METAL_LIBRARY}
|
||||
)
|
||||
endif()
|
||||
|
||||
# OpenGL backend
|
||||
if(USE_OPENGL)
|
||||
# Enable GLSL compiler output.
|
||||
list(APPEND ANGLE_DEFINITIONS ANGLE_ENABLE_GLSL)
|
||||
endif()
|
||||
|
||||
if(USE_ANGLE_EGL OR ENABLE_WEBGL)
|
||||
list(APPEND ANGLE_SOURCES
|
||||
${_gl_backend_sources}
|
||||
|
||||
${libangle_gl_egl_dl_sources}
|
||||
${libangle_gl_egl_sources}
|
||||
${libangle_gl_sources}
|
||||
)
|
||||
|
||||
list(APPEND ANGLE_DEFINITIONS
|
||||
ANGLE_ENABLE_OPENGL
|
||||
)
|
||||
endif()
|
66
ports/angle/cmake-buildsystem/PlatformWin.cmake
Normal file
66
ports/angle/cmake-buildsystem/PlatformWin.cmake
Normal file
@ -0,0 +1,66 @@
|
||||
# We're targeting Windows 10 which will have DirectX 11 on it so require that
|
||||
# but make DirectX 9 optional
|
||||
|
||||
list(APPEND ANGLE_DEFINITIONS
|
||||
GL_APICALL=
|
||||
GL_API=
|
||||
NOMINMAX
|
||||
)
|
||||
|
||||
# We're targeting Windows 10 which will have DirectX 11
|
||||
list(APPEND ANGLE_SOURCES
|
||||
${_d3d11_backend_sources}
|
||||
${_d3d_shared_sources}
|
||||
|
||||
${angle_translator_hlsl_sources}
|
||||
|
||||
${libangle_gpu_info_util_sources}
|
||||
${libangle_gpu_info_util_win_sources}
|
||||
)
|
||||
|
||||
list(APPEND ANGLE_DEFINITIONS
|
||||
ANGLE_ENABLE_D3D11
|
||||
ANGLE_ENABLE_HLSL
|
||||
# VCPKG EDIT: add ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES
|
||||
"-DANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ \"d3dcompiler_47.dll\", \"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }"
|
||||
)
|
||||
|
||||
list(APPEND ANGLEGLESv2_LIBRARIES dxguid dxgi)
|
||||
|
||||
if(NOT angle_is_winuwp) # vcpkg EDIT: Exclude DirectX 9 on UWP
|
||||
# DirectX 9 support should be optional but ANGLE will not compile without it
|
||||
list(APPEND ANGLE_SOURCES ${_d3d9_backend_sources})
|
||||
list(APPEND ANGLE_DEFINITIONS ANGLE_ENABLE_D3D9)
|
||||
list(APPEND ANGLEGLESv2_LIBRARIES d3d9)
|
||||
endif()
|
||||
|
||||
# VCPKG EDITS:
|
||||
|
||||
# Do not specify library type here
|
||||
|
||||
# Handle angle_enable_d3d11_compositor_native_window defines
|
||||
|
||||
if(angle_enable_d3d11_compositor_native_window)
|
||||
list(APPEND ANGLE_DEFINITIONS ANGLE_ENABLE_D3D11_COMPOSITOR_NATIVE_WINDOW)
|
||||
endif()
|
||||
|
||||
# OpenGL backend
|
||||
|
||||
if(USE_OPENGL)
|
||||
# Enable GLSL compiler output.
|
||||
list(APPEND ANGLE_DEFINITIONS ANGLE_ENABLE_GLSL)
|
||||
|
||||
if(USE_ANGLE_EGL OR ENABLE_WEBGL)
|
||||
list(APPEND ANGLE_SOURCES
|
||||
${_gl_backend_sources}
|
||||
|
||||
${libangle_gl_egl_dl_sources}
|
||||
${libangle_gl_egl_sources}
|
||||
${libangle_gl_sources}
|
||||
)
|
||||
|
||||
list(APPEND ANGLE_DEFINITIONS
|
||||
ANGLE_ENABLE_OPENGL
|
||||
)
|
||||
endif()
|
||||
endif()
|
192
ports/angle/cmake-buildsystem/cmake/WebKitCommon-minimal.cmake
Normal file
192
ports/angle/cmake-buildsystem/cmake/WebKitCommon-minimal.cmake
Normal file
@ -0,0 +1,192 @@
|
||||
# VCPKG NOTE: A minimal version of WebKit's https://github.com/WebKit/WebKit/blob/647e67b23883960fef8890465c0f70d7ab6e63f1/Source/cmake/WebKitCommon.cmake
|
||||
# To support the adapted ANGLE CMake buildsystem
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# This file is included individually from various subdirectories (JSC, WTF,
|
||||
# WebCore, WebKit) in order to allow scripts to build only part of WebKit.
|
||||
# We want to run this file only once.
|
||||
# -----------------------------------------------------------------------------
|
||||
if (NOT HAS_RUN_WEBKIT_COMMON)
|
||||
set(HAS_RUN_WEBKIT_COMMON TRUE)
|
||||
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
message(WARNING "No CMAKE_BUILD_TYPE value specified, defaulting to RelWithDebInfo.")
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build." FORCE)
|
||||
else ()
|
||||
message(STATUS "The CMake build type is: ${CMAKE_BUILD_TYPE}")
|
||||
endif ()
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Determine which port will be built
|
||||
# -----------------------------------------------------------------------------
|
||||
set(ALL_PORTS
|
||||
AppleWin
|
||||
Efl
|
||||
FTW
|
||||
GTK
|
||||
JSCOnly
|
||||
Mac
|
||||
PlayStation
|
||||
WPE
|
||||
WinCairo
|
||||
Linux # VCPKG EDIT: Add "Linux" so it's properly supported for ANGLE build
|
||||
Win # VCPKG EDIT: Add "Win" so it's properly supported for ANGLE build
|
||||
)
|
||||
set(PORT "NOPORT" CACHE STRING "choose which WebKit port to build (one of ${ALL_PORTS})")
|
||||
|
||||
list(FIND ALL_PORTS ${PORT} RET)
|
||||
if (${RET} EQUAL -1)
|
||||
if (APPLE)
|
||||
set(PORT "Mac")
|
||||
else ()
|
||||
message(WARNING "Please choose which WebKit port to build (one of ${ALL_PORTS})")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
string(TOLOWER ${PORT} WEBKIT_PORT_DIR)
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Determine the compiler
|
||||
# -----------------------------------------------------------------------------
|
||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang")
|
||||
set(COMPILER_IS_CLANG ON)
|
||||
endif ()
|
||||
|
||||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
||||
if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "9.3.0")
|
||||
message(FATAL_ERROR "GCC 9.3 or newer is required to build WebKit. Use a newer GCC version or Clang.")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
|
||||
set(COMPILER_IS_GCC_OR_CLANG ON)
|
||||
endif ()
|
||||
|
||||
if (MSVC AND COMPILER_IS_CLANG)
|
||||
set(COMPILER_IS_CLANG_CL ON)
|
||||
endif ()
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Determine the target processor
|
||||
# -----------------------------------------------------------------------------
|
||||
# Use MSVC_CXX_ARCHITECTURE_ID instead of CMAKE_SYSTEM_PROCESSOR when defined,
|
||||
# since the later one just resolves to the host processor on Windows.
|
||||
if (MSVC_CXX_ARCHITECTURE_ID)
|
||||
string(TOLOWER ${MSVC_CXX_ARCHITECTURE_ID} LOWERCASE_CMAKE_SYSTEM_PROCESSOR)
|
||||
else ()
|
||||
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_SYSTEM_PROCESSOR)
|
||||
endif ()
|
||||
if (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(^aarch64|^arm64|^cortex-?[am][2-7][2-8])")
|
||||
set(WTF_CPU_ARM64 1)
|
||||
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(^arm|^cortex)")
|
||||
set(WTF_CPU_ARM 1)
|
||||
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^mips64")
|
||||
set(WTF_CPU_MIPS64 1)
|
||||
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
|
||||
set(WTF_CPU_MIPS 1)
|
||||
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(x64|x86_64|amd64)")
|
||||
# FORCE_32BIT is set in the build script when --32-bit is passed
|
||||
# on a Linux/intel 64bit host. This allows us to produce 32bit
|
||||
# binaries without setting the build up as a crosscompilation,
|
||||
# which is the only way to modify CMAKE_SYSTEM_PROCESSOR.
|
||||
if (FORCE_32BIT)
|
||||
set(WTF_CPU_X86 1)
|
||||
else ()
|
||||
set(WTF_CPU_X86_64 1)
|
||||
endif ()
|
||||
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|x86)")
|
||||
set(WTF_CPU_X86 1)
|
||||
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "ppc")
|
||||
set(WTF_CPU_PPC 1)
|
||||
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
|
||||
set(WTF_CPU_PPC64 1)
|
||||
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le")
|
||||
set(WTF_CPU_PPC64LE 1)
|
||||
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^riscv64")
|
||||
set(WTF_CPU_RISCV64 1)
|
||||
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "^loongarch64")
|
||||
set(WTF_CPU_LOONGARCH64 1)
|
||||
else ()
|
||||
set(WTF_CPU_UNKNOWN 1)
|
||||
endif ()
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Determine the operating system
|
||||
# -----------------------------------------------------------------------------
|
||||
if (UNIX)
|
||||
if (APPLE)
|
||||
set(WTF_OS_MAC_OS_X 1)
|
||||
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
set(WTF_OS_LINUX 1)
|
||||
else ()
|
||||
set(WTF_OS_UNIX 1)
|
||||
endif ()
|
||||
elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
||||
set(WTF_OS_WINDOWS 1)
|
||||
elseif (CMAKE_SYSTEM_NAME MATCHES "Fuchsia")
|
||||
set(WTF_OS_FUCHSIA 1)
|
||||
else ()
|
||||
message(FATAL_ERROR "Unknown OS '${CMAKE_SYSTEM_NAME}'")
|
||||
endif ()
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Default library types
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE True)
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Default output directories, which can be overwritten by ports
|
||||
#------------------------------------------------------------------------------
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Find common packages (used by all ports)
|
||||
# -----------------------------------------------------------------------------
|
||||
if (WIN32)
|
||||
list(APPEND CMAKE_PROGRAM_PATH $ENV{SystemDrive}/cygwin/bin)
|
||||
endif ()
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Helper macros and feature defines
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
# To prevent multiple inclusion, most modules should be included once here.
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCXXCompilerFlag)
|
||||
include(CheckCXXSourceCompiles)
|
||||
include(CheckFunctionExists)
|
||||
include(CheckIncludeFile)
|
||||
include(CheckSymbolExists)
|
||||
include(CheckStructHasMember)
|
||||
include(CheckTypeSize)
|
||||
include(CMakeDependentOption)
|
||||
include(CMakeParseArguments)
|
||||
include(CMakePushCheckState)
|
||||
include(ProcessorCount)
|
||||
|
||||
# include(WebKitPackaging)
|
||||
include(WebKitMacros)
|
||||
# include(WebKitFS)
|
||||
# include(WebKitCCache)
|
||||
include(WebKitCompilerFlags)
|
||||
# include(WebKitStaticAnalysis)
|
||||
# include(WebKitFeatures)
|
||||
# include(WebKitFindPackage)
|
||||
|
||||
# include(OptionsCommon)
|
||||
# include(Options${PORT})
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Job pool to avoid running too many memory hungry linker processes
|
||||
# -----------------------------------------------------------------------------
|
||||
if (${CMAKE_BUILD_TYPE} STREQUAL "Release" OR ${CMAKE_BUILD_TYPE} STREQUAL "MinSizeRel")
|
||||
set_property(GLOBAL PROPERTY JOB_POOLS link_pool_jobs=4)
|
||||
else ()
|
||||
set_property(GLOBAL PROPERTY JOB_POOLS link_pool_jobs=2)
|
||||
endif ()
|
||||
set(CMAKE_JOB_POOL_LINK link_pool_jobs)
|
||||
|
||||
endif ()
|
6
ports/angle/cmake-buildsystem/linux.cmake
Normal file
6
ports/angle/cmake-buildsystem/linux.cmake
Normal file
@ -0,0 +1,6 @@
|
||||
if(is_android OR is_linux OR is_chromeos)
|
||||
set(angle_dma_buf_sources
|
||||
"src/common/linux/dma_buf_utils.cpp"
|
||||
"src/common/linux/dma_buf_utils.h"
|
||||
)
|
||||
endif()
|
@ -15,11 +15,32 @@ else()
|
||||
message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}")
|
||||
endif()
|
||||
|
||||
set(ANGLE_USE_D3D11_COMPOSITOR_NATIVE_WINDOW "OFF")
|
||||
if (VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
|
||||
set(ANGLE_BUILDSYSTEM_PORT "Win")
|
||||
if (NOT MINGW)
|
||||
set(ANGLE_USE_D3D11_COMPOSITOR_NATIVE_WINDOW "ON")
|
||||
endif()
|
||||
elseif (VCPKG_TARGET_IS_OSX)
|
||||
set(ANGLE_BUILDSYSTEM_PORT "Mac")
|
||||
elseif (VCPKG_TARGET_IS_LINUX)
|
||||
set(ANGLE_BUILDSYSTEM_PORT "Linux")
|
||||
else()
|
||||
# default other platforms to "Linux" config
|
||||
set(ANGLE_BUILDSYSTEM_PORT "Linux")
|
||||
endif()
|
||||
|
||||
# chromium/5414
|
||||
set(ANGLE_COMMIT aa63ea230e0c507e7b4b164a30e502fb17168c17)
|
||||
set(ANGLE_VERSION 5414)
|
||||
set(ANGLE_SHA512 a3b55d4b484e1e9ece515d60af1d47a80a0576b198d9a2397e4e68b16efd83468dcdfadc98dae57ff17f01d02d74526f8b59fdf00661b70a45b6dd266e5ffe38)
|
||||
set(ANGLE_THIRDPARTY_ZLIB_COMMIT 44d9b490c721abdb923d5c6c23ac211e45ffb1a5)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO google/angle
|
||||
REF d15be77864e18f407c317be6f6bc06ee2b7d070a # chromium/4472
|
||||
SHA512 aad8563ee65458a7865ec7c668d1f90ac2891583c569a22dcd2c557263b72b26386f56b74a7294398be2cf5c548df513159e4be53f3f096f19819ca06227d9ac
|
||||
REF ${ANGLE_COMMIT}
|
||||
SHA512 ${ANGLE_SHA512}
|
||||
# On update check headers against opengl-registry
|
||||
PATCHES
|
||||
001-fix-uwp.patch
|
||||
@ -27,12 +48,89 @@ vcpkg_from_github(
|
||||
003-fix-mingw.patch
|
||||
)
|
||||
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
||||
# Generate angle_commit.h
|
||||
set(ANGLE_COMMIT_HASH_SIZE 12)
|
||||
string(SUBSTRING "${ANGLE_COMMIT}" 0 ${ANGLE_COMMIT_HASH_SIZE} ANGLE_COMMIT_HASH)
|
||||
set(ANGLE_COMMIT_DATE "invalid-date")
|
||||
set(ANGLE_REVISION "${ANGLE_VERSION}")
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/angle_commit.h.in" "${SOURCE_PATH}/angle_commit.h" @ONLY)
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/angle_commit.h.in" "${SOURCE_PATH}/src/common/angle_commit.h" @ONLY)
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/unofficial-angle-config.cmake" DESTINATION "${SOURCE_PATH}")
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/angle_commit.h" DESTINATION "${SOURCE_PATH}")
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/angle_commit.h" DESTINATION "${SOURCE_PATH}/src/common")
|
||||
|
||||
function(checkout_in_path_with_patches PATH URL REF PATCHES)
|
||||
set(ANGLE_WEBKIT_BUILDSYSTEM_COMMIT "bb1da00b9ba878d228a5e9834a0767dbca2fee43")
|
||||
|
||||
# Download WebKit gni-to-cmake.py conversion script
|
||||
vcpkg_download_distfile(GNI_TO_CMAKE_PY
|
||||
URLS "https://github.com/WebKit/WebKit/raw/${ANGLE_WEBKIT_BUILDSYSTEM_COMMIT}/Source/ThirdParty/ANGLE/gni-to-cmake.py"
|
||||
FILENAME "gni-to-cmake.py"
|
||||
SHA512 9da35caf2db2e849d6cc85721ba0b77eee06b6f65a7c5314fb80483db4949b0b6e9bf4b2d4fc63613665629b24e9b052e03fb1451b09313d881297771a4f2736
|
||||
)
|
||||
|
||||
# Generate CMake files from GN / GNI files
|
||||
vcpkg_find_acquire_program(PYTHON3)
|
||||
|
||||
set(_root_gni_files_to_convert
|
||||
"compiler.gni Compiler.cmake"
|
||||
"libGLESv2.gni GLESv2.cmake"
|
||||
)
|
||||
set(_renderer_gn_files_to_convert
|
||||
"libANGLE/renderer/d3d/BUILD.gn D3D.cmake"
|
||||
"libANGLE/renderer/gl/BUILD.gn GL.cmake"
|
||||
"libANGLE/renderer/metal/BUILD.gn Metal.cmake"
|
||||
)
|
||||
|
||||
foreach(_root_gni_file IN LISTS _root_gni_files_to_convert)
|
||||
separate_arguments(_file_values UNIX_COMMAND "${_root_gni_file}")
|
||||
list(GET _file_values 0 _src_gn_file)
|
||||
list(GET _file_values 1 _dst_file)
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND "${PYTHON3}" "${GNI_TO_CMAKE_PY}" "src/${_src_gn_file}" "${_dst_file}"
|
||||
WORKING_DIRECTORY "${SOURCE_PATH}"
|
||||
LOGNAME "gni-to-cmake-${_dst_file}-${TARGET_TRIPLET}"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
foreach(_renderer_gn_file IN LISTS _renderer_gn_files_to_convert)
|
||||
separate_arguments(_file_values UNIX_COMMAND "${_renderer_gn_file}")
|
||||
list(GET _file_values 0 _src_gn_file)
|
||||
list(GET _file_values 1 _dst_file)
|
||||
get_filename_component(_src_dir "${_src_gn_file}" DIRECTORY)
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND "${PYTHON3}" "${GNI_TO_CMAKE_PY}" "src/${_src_gn_file}" "${_dst_file}" --prepend "src/${_src_dir}/"
|
||||
WORKING_DIRECTORY "${SOURCE_PATH}"
|
||||
LOGNAME "gni-to-cmake-${_dst_file}-${TARGET_TRIPLET}"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
# Fetch additional CMake files from WebKit ANGLE buildsystem
|
||||
vcpkg_download_distfile(WK_ANGLE_INCLUDE_CMAKELISTS
|
||||
URLS "https://github.com/WebKit/WebKit/raw/${ANGLE_WEBKIT_BUILDSYSTEM_COMMIT}/Source/ThirdParty/ANGLE/include/CMakeLists.txt"
|
||||
FILENAME "include_CMakeLists.txt"
|
||||
SHA512 a7ddf3c6df7565e232f87ec651cc4fd84240b8866609e23e3e6e41d22532fd34c70e0f3b06120fd3d6d930ca29c1d0d470d4c8cb7003a66f8c1a840a42f32949
|
||||
)
|
||||
configure_file("${WK_ANGLE_INCLUDE_CMAKELISTS}" "${SOURCE_PATH}/include/CMakeLists.txt" COPYONLY)
|
||||
|
||||
vcpkg_download_distfile(WK_ANGLE_CMAKE_WEBKITCOMPILERFLAGS
|
||||
URLS "https://github.com/WebKit/WebKit/raw/${ANGLE_WEBKIT_BUILDSYSTEM_COMMIT}/Source/cmake/WebKitCompilerFlags.cmake"
|
||||
FILENAME "WebKitCompilerFlags.cmake"
|
||||
SHA512 63f981694ae37d4c4ca4c34e2bf62b4d4602b6a1a660851304fa7a6ee834fc58fa6730eeb41ef4e075550f3c8b675823d4d00bdcd72ca869c6d5ab11196b33bb
|
||||
)
|
||||
file(COPY "${WK_ANGLE_CMAKE_WEBKITCOMPILERFLAGS}" DESTINATION "${SOURCE_PATH}/cmake")
|
||||
|
||||
vcpkg_download_distfile(WK_ANGLE_CMAKE_WEBKITMACROS
|
||||
URLS "https://github.com/WebKit/WebKit/raw/${ANGLE_WEBKIT_BUILDSYSTEM_COMMIT}/Source/cmake/WebKitMacros.cmake"
|
||||
FILENAME "WebKitMacros.cmake"
|
||||
SHA512 0d126b1d1b0ca995c2ea6e51c73326db363f560f3f07912ce58c7c022d9257d27b963dac56aee0e9604ca7a3d74c5aa9f0451c243fec922fb485dd2253685ab6
|
||||
)
|
||||
file(COPY "${WK_ANGLE_CMAKE_WEBKITMACROS}" DESTINATION "${SOURCE_PATH}/cmake")
|
||||
|
||||
# Copy additional custom CMake buildsystem into appropriate folders
|
||||
file(GLOB MAIN_BUILDSYSTEM "${CMAKE_CURRENT_LIST_DIR}/cmake-buildsystem/CMakeLists.txt" "${CMAKE_CURRENT_LIST_DIR}/cmake-buildsystem/*.cmake")
|
||||
file(COPY ${MAIN_BUILDSYSTEM} DESTINATION "${SOURCE_PATH}")
|
||||
file(GLOB MODULES "${CMAKE_CURRENT_LIST_DIR}/cmake-buildsystem/cmake/*.cmake")
|
||||
file(COPY ${MODULES} DESTINATION "${SOURCE_PATH}/cmake")
|
||||
|
||||
function(checkout_in_path PATH URL REF)
|
||||
if(EXISTS "${PATH}")
|
||||
return()
|
||||
endif()
|
||||
@ -41,17 +139,15 @@ function(checkout_in_path_with_patches PATH URL REF PATCHES)
|
||||
OUT_SOURCE_PATH DEP_SOURCE_PATH
|
||||
URL "${URL}"
|
||||
REF "${REF}"
|
||||
PATCHES ${PATCHES}
|
||||
)
|
||||
file(RENAME "${DEP_SOURCE_PATH}" "${PATH}")
|
||||
file(REMOVE_RECURSE "${DEP_SOURCE_PATH}")
|
||||
endfunction()
|
||||
|
||||
checkout_in_path_with_patches(
|
||||
checkout_in_path(
|
||||
"${SOURCE_PATH}/third_party/zlib"
|
||||
"https://chromium.googlesource.com/chromium/src/third_party/zlib"
|
||||
"09490503d0f201b81e03f5ca0ab8ba8ee76d4a8e"
|
||||
"third-party-zlib-far-undef.patch"
|
||||
"${ANGLE_THIRDPARTY_ZLIB_COMMIT}"
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
@ -59,6 +155,8 @@ vcpkg_cmake_configure(
|
||||
OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=1
|
||||
OPTIONS
|
||||
"-D${ANGLE_CPU_BITNESS}=1"
|
||||
"-DPORT=${ANGLE_BUILDSYSTEM_PORT}"
|
||||
"-DANGLE_USE_D3D11_COMPOSITOR_NATIVE_WINDOW=${ANGLE_USE_D3D11_COMPOSITOR_NATIVE_WINDOW}"
|
||||
"-DVCPKG_TARGET_IS_WINDOWS=${VCPKG_TARGET_IS_WINDOWS}"
|
||||
)
|
||||
|
||||
|
@ -1,13 +0,0 @@
|
||||
diff --git a/google/compression_utils_portable.h b/google/compression_utils_portable.h
|
||||
--- a/google/compression_utils_portable.h
|
||||
+++ b/google/compression_utils_portable.h
|
||||
@@ -13,6 +13,9 @@
|
||||
* zlib.
|
||||
*/
|
||||
#if defined(USE_SYSTEM_ZLIB)
|
||||
+# if defined(WIN32) && defined(FAR)
|
||||
+# undef FAR
|
||||
+# endif
|
||||
#include <zlib.h>
|
||||
/* AOSP build requires relative paths. */
|
||||
#else
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "angle",
|
||||
"version-string": "chromium_4472",
|
||||
"port-version": 8,
|
||||
"version-string": "chromium_5414",
|
||||
"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."
|
||||
|
32
scripts/angle/maintainer-notes.md
Normal file
32
scripts/angle/maintainer-notes.md
Normal file
@ -0,0 +1,32 @@
|
||||
# The ANGLE vcpkg port
|
||||
|
||||
The ANGLE port's buildsystem is based off of [WebKit's approach](https://github.com/WebKit/WebKit/tree/main/Source/ThirdParty/ANGLE) to converting ANGLE's buildsystem to CMake.
|
||||
|
||||
Details:
|
||||
|
||||
- `cmake-buildsystem/CMakeLists.txt`
|
||||
- This is an augmented version of WebKit's [CMakeLists.txt](https://github.com/WebKit/WebKit/blob/main/Source/ThirdParty/ANGLE/CMakeLists.txt), with vcpkg edits and additions.
|
||||
- `cmake-buildsystem/*.cmake`
|
||||
- These are configuration files based on [WebKit's approach](https://github.com/WebKit/WebKit/tree/main/Source/ThirdParty/ANGLE), but customized for vcpkg (and using `PlatformLinux` instead of `PlatformGTK`)
|
||||
|
||||
|
||||
## Updating the ANGLE vcpkg port
|
||||
|
||||
1. Select a new ANGLE version
|
||||
|
||||
Recommendation: Follow the recommendations in the libANGLE "[Choosing an ANGLE branch](https://github.com/google/angle/blob/master/doc/ChoosingANGLEBranch.md#matching-a-chromium-release-to-an-angle-branch)" guide, and find the branch that matches the current Chromium Stable.
|
||||
|
||||
2. [Find the branch](https://github.com/google/angle/branches) (usually `chromium/<version>`) and latest commit on that branch, and update the following variables in `portfile.cmake`:
|
||||
- `ANGLE_COMMIT`
|
||||
- `ANGLE_VERSION`
|
||||
- `ANGLE_SHA512`
|
||||
|
||||
3. Check the `DEPS` file at that ANGLE commit, for the commit used in `'third_party/zlib'`, and update `ANGLE_THIRDPARTY_ZLIB_COMMIT` in `portfile.cmake` if necessary.
|
||||
|
||||
4. Attempt to build. You may have to tweak the `CMakeLists.txt`, `Platform*.cmake` files, etc. Check with the latest files in [WebKit's repo](https://github.com/WebKit/WebKit/tree/main/Source/ThirdParty/ANGLE) to see if any updates need to be ported to the vcpkg's custom files. You might also need to change the `ANGLE_WEBKIT_BUILDSYSTEM_COMMIT` in the portfile (although this should theoretically need updating less frequently).
|
||||
|
||||
5. Check headers against `opengl-registry` - make sure headers are similar.
|
||||
> angle defines some additional entrypoints.
|
||||
> opengl-registry should be latest before updating angle
|
||||
|
||||
6. Complete all the other normal steps in the [Maintainer Guide](/docs/maintainers/maintainer-guide.md)
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "4d21d50c6a69b88182c328b4867a27909fa34b01",
|
||||
"version-string": "chromium_5414",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "3b82e62ec84b36302f2e1b7a6356811d367dd88f",
|
||||
"version-string": "chromium_4472",
|
||||
|
@ -117,8 +117,8 @@
|
||||
"port-version": 0
|
||||
},
|
||||
"angle": {
|
||||
"baseline": "chromium_4472",
|
||||
"port-version": 8
|
||||
"baseline": "chromium_5414",
|
||||
"port-version": 0
|
||||
},
|
||||
"antlr4": {
|
||||
"baseline": "4.11.1",
|
||||
|
Loading…
Reference in New Issue
Block a user