2019-12-24 06:39:17 +08:00
if ( VCPKG_TARGET_IS_LINUX )
2019-09-30 01:25:14 +08:00
message ( WARNING "Building with a gcc version less than 6.1 is not supported." )
2022-09-30 05:30:01 +08:00
message ( WARNING "${PORT} currently requires the following libraries from the system package manager:\n libx11-dev\n mesa-common-dev\n libxi-dev\n libxext-dev\n\nThese can be installed on Ubuntu systems via apt-get install libx11-dev mesa-common-dev libxi-dev libxext-dev." )
2019-09-30 01:25:14 +08:00
endif ( )
2019-05-03 13:57:43 +08:00
if ( VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" )
set ( ANGLE_CPU_BITNESS ANGLE_IS_32_BIT_CPU )
elseif ( VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" )
set ( ANGLE_CPU_BITNESS ANGLE_IS_64_BIT_CPU )
elseif ( VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" )
set ( ANGLE_CPU_BITNESS ANGLE_IS_32_BIT_CPU )
2020-01-23 05:06:38 +08:00
elseif ( VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" )
set ( ANGLE_CPU_BITNESS ANGLE_IS_64_BIT_CPU )
2019-05-03 13:57:43 +08:00
else ( )
message ( FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}" )
endif ( )
vcpkg_from_github (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
R E P O g o o g l e / a n g l e
2021-07-21 02:56:02 +08:00
R E F d 1 5 b e 7 7 8 6 4 e 1 8 f 4 0 7 c 3 1 7 b e 6 f 6 b c 0 6 e e 2 b 7 d 0 7 0 a # chromium/4472
S H A 5 1 2 a a d 8 5 6 3 e e 6 5 4 5 8 a 7 8 6 5 e c 7 c 6 6 8 d 1 f 9 0 a c 2 8 9 1 5 8 3 c 5 6 9 a 2 2 d c d 2 c 5 5 7 2 6 3 b 7 2 b 2 6 3 8 6 f 5 6 b 7 4 a 7 2 9 4 3 9 8 b e 2 c f 5 c 5 4 8 d f 5 1 3 1 5 9 e 4 b e 5 3 f 3 f 0 9 6 f 1 9 8 1 9 c a 0 6 2 2 7 d 9 a c
2020-04-07 05:49:51 +08:00
# On update check headers against opengl-registry
2020-01-23 05:06:38 +08:00
P A T C H E S
2019-05-03 13:57:43 +08:00
0 0 1 - f i x - u w p . p a t c h
2019-12-24 06:39:17 +08:00
0 0 2 - f i x - b u i l d e r - e r r o r . p a t c h
2021-08-19 08:21:04 +08:00
0 0 3 - f i x - m i n g w . p a t c h
2019-05-03 13:57:43 +08:00
)
2022-10-12 16:21:25 +08:00
file ( COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" 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" )
2021-07-21 02:56:02 +08:00
function ( checkout_in_path_with_patches PATH URL REF PATCHES )
if ( EXISTS "${PATH}" )
return ( )
endif ( )
vcpkg_from_git (
O U T _ S O U R C E _ P A T H D E P _ S O U R C E _ P A T H
U R L " $ { U R L } "
R E F " $ { R E F } "
P A T C H E S $ { P A T C H E S }
)
file ( RENAME "${DEP_SOURCE_PATH}" "${PATH}" )
file ( REMOVE_RECURSE "${DEP_SOURCE_PATH}" )
endfunction ( )
checkout_in_path_with_patches (
" $ { S O U R C E _ P A T H } / t h i r d _ p a r t y / z l i b "
" h t t p s : / / c h r o m i u m . g o o g l e s o u r c e . c o m / c h r o m i u m / s r c / t h i r d _ p a r t y / z l i b "
" 0 9 4 9 0 5 0 3 d 0 f 2 0 1 b 8 1 e 0 3 f 5 c a 0 a b 8 b a 8 e e 7 6 d 4 a 8 e "
" t h i r d - p a r t y - z l i b - f a r - u n d e f . p a t c h "
)
2019-05-03 13:57:43 +08:00
2022-10-12 16:21:25 +08:00
vcpkg_cmake_configure (
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
2019-05-03 13:57:43 +08:00
O P T I O N S _ D E B U G - D D I S A B L E _ I N S T A L L _ H E A D E R S = 1
O P T I O N S
- D $ { A N G L E _ C P U _ B I T N E S S } = 1
)
2022-10-12 16:21:25 +08:00
vcpkg_cmake_install ( )
2019-05-03 13:57:43 +08:00
2022-10-12 16:21:25 +08:00
vcpkg_cmake_config_fixup ( CONFIG_PATH share/unofficial-angle PACKAGE_NAME unofficial-angle )
2019-05-03 13:57:43 +08:00
vcpkg_copy_pdbs ( )
2022-10-12 16:21:25 +08:00
file ( INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright )
2020-04-07 05:49:51 +08:00
# File conflict with opengl-registry! Make sure headers are similar on Update!
# 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
# 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
i n c l u d e / G L E S / e g l . h
i n c l u d e / G L E S / g l . h
i n c l u d e / G L E S / g l e x t . h
i n c l u d e / G L E S / g l p l a t f o r m . h
i n c l u d e / G L E S 2 / g l 2 . h
i n c l u d e / G L E S 2 / g l 2 e x t . h
i n c l u d e / G L E S 2 / g l 2 p l a t f o r m . h
i n c l u d e / G L E S 3 / g l 3 . h
i n c l u d e / G L E S 3 / g l 3 1 . h
i n c l u d e / G L E S 3 / g l 3 2 . h
i n c l u d e / G L E S 3 / g l 3 p l a t f o r m . h )
foreach ( _file ${ _double_files } )
if ( EXISTS "${CURRENT_PACKAGES_DIR}/${_file}" )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/${_file}" )
endif ( )
endforeach ( )