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 ( )
2023-02-11 03:45:11 +08:00
set ( ANGLE_USE_D3D11_COMPOSITOR_NATIVE_WINDOW "OFF" )
if ( VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP )
set ( ANGLE_BUILDSYSTEM_PORT "Win" )
2024-06-15 02:40:01 +08:00
if ( NOT VCPKG_TARGET_IS_MINGW )
2023-02-11 03:45:11 +08:00
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 )
2019-05-03 13:57:43 +08:00
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
2023-02-11 03:45:11 +08:00
R E F $ { A N G L E _ C O M M I T }
S H A 5 1 2 $ { A N G L E _ S H A 5 1 2 }
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
)
2023-02-11 03:45:11 +08:00
# 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 )
2023-01-05 06:41:32 +08:00
file ( COPY "${CMAKE_CURRENT_LIST_DIR}/unofficial-angle-config.cmake" DESTINATION "${SOURCE_PATH}" )
2021-07-21 02:56:02 +08:00
2023-02-11 03:45:11 +08:00
set ( ANGLE_WEBKIT_BUILDSYSTEM_COMMIT "bb1da00b9ba878d228a5e9834a0767dbca2fee43" )
# Download WebKit gni-to-cmake.py conversion script
vcpkg_download_distfile ( GNI_TO_CMAKE_PY
U R L S " h t t p s : / / g i t h u b . c o m / W e b K i t / W e b K i t / r a w / $ { A N G L E _ W E B K I T _ B U I L D S Y S T E M _ C O M M I T } / S o u r c e / T h i r d P a r t y / A N G L E / g n i - t o - c m a k e . p y "
F I L E N A M E " g n i - t o - c m a k e . p y "
S H A 5 1 2 9 d a 3 5 c a f 2 d b 2 e 8 4 9 d 6 c c 8 5 7 2 1 b a 0 b 7 7 e e e 0 6 b 6 f 6 5 a 7 c 5 3 1 4 f b 8 0 4 8 3 d b 4 9 4 9 b 0 b 6 e 9 b f 4 b 2 d 4 f c 6 3 6 1 3 6 6 5 6 2 9 b 2 4 e 9 b 0 5 2 e 0 3 f b 1 4 5 1 b 0 9 3 1 3 d 8 8 1 2 9 7 7 7 1 a 4 f 2 7 3 6
)
# Generate CMake files from GN / GNI files
vcpkg_find_acquire_program ( PYTHON3 )
set ( _root_gni_files_to_convert
" c o m p i l e r . g n i C o m p i l e r . c m a k e "
" l i b G L E S v 2 . g n i G L E S v 2 . c m a k e "
)
set ( _renderer_gn_files_to_convert
" l i b A N G L E / r e n d e r e r / d 3 d / B U I L D . g n D 3 D . c m a k e "
" l i b A N G L E / r e n d e r e r / g l / B U I L D . g n G L . c m a k e "
" l i b A N G L E / r e n d e r e r / m e t a l / B U I L D . g n M e t a l . c m a k e "
)
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 (
C O M M A N D " $ { P Y T H O N 3 } " " $ { G N I _ T O _ C M A K E _ P Y } " " s r c / $ { _ s r c _ g n _ f i l e } " " $ { _ d s t _ f i l e } "
W O R K I N G _ D I R E C T O R Y " $ { S O U R C E _ P A T H } "
L O G N A M E " g n i - t o - c m a k e - $ { _ d s t _ f i l e } - $ { T A R G E T _ T R I P L E T } "
)
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 (
C O M M A N D " $ { P Y T H O N 3 } " " $ { G N I _ T O _ C M A K E _ P Y } " " s r c / $ { _ s r c _ g n _ f i l e } " " $ { _ d s t _ f i l e } " - - p r e p e n d " s r c / $ { _ s r c _ d i r } / "
W O R K I N G _ D I R E C T O R Y " $ { S O U R C E _ P A T H } "
L O G N A M E " g n i - t o - c m a k e - $ { _ d s t _ f i l e } - $ { T A R G E T _ T R I P L E T } "
)
endforeach ( )
# Fetch additional CMake files from WebKit ANGLE buildsystem
vcpkg_download_distfile ( WK_ANGLE_INCLUDE_CMAKELISTS
U R L S " h t t p s : / / g i t h u b . c o m / W e b K i t / W e b K i t / r a w / $ { A N G L E _ W E B K I T _ B U I L D S Y S T E M _ C O M M I T } / S o u r c e / T h i r d P a r t y / A N G L E / i n c l u d e / C M a k e L i s t s . t x t "
F I L E N A M E " i n c l u d e _ C M a k e L i s t s . t x t "
S H A 5 1 2 a 7 d d f 3 c 6 d f 7 5 6 5 e 2 3 2 f 8 7 e c 6 5 1 c c 4 f d 8 4 2 4 0 b 8 8 6 6 6 0 9 e 2 3 e 3 e 6 e 4 1 d 2 2 5 3 2 f d 3 4 c 7 0 e 0 f 3 b 0 6 1 2 0 f d 3 d 6 d 9 3 0 c a 2 9 c 1 d 0 d 4 7 0 d 4 c 8 c b 7 0 0 3 a 6 6 f 8 c 1 a 8 4 0 a 4 2 f 3 2 9 4 9
)
configure_file ( "${WK_ANGLE_INCLUDE_CMAKELISTS}" "${SOURCE_PATH}/include/CMakeLists.txt" COPYONLY )
vcpkg_download_distfile ( WK_ANGLE_CMAKE_WEBKITCOMPILERFLAGS
U R L S " h t t p s : / / g i t h u b . c o m / W e b K i t / W e b K i t / r a w / $ { A N G L E _ W E B K I T _ B U I L D S Y S T E M _ C O M M I T } / S o u r c e / c m a k e / W e b K i t C o m p i l e r F l a g s . c m a k e "
F I L E N A M E " W e b K i t C o m p i l e r F l a g s . c m a k e "
S H A 5 1 2 6 3 f 9 8 1 6 9 4 a e 3 7 d 4 c 4 c a 4 c 3 4 e 2 b f 6 2 b 4 d 4 6 0 2 b 6 a 1 a 6 6 0 8 5 1 3 0 4 f a 7 a 6 e e 8 3 4 f c 5 8 f a 6 7 3 0 e e b 4 1 e f 4 e 0 7 5 5 5 0 f 3 c 8 b 6 7 5 8 2 3 d 4 d 0 0 b d c d 7 2 c a 8 6 9 c 6 d 5 a b 1 1 1 9 6 b 3 3 b b
)
file ( COPY "${WK_ANGLE_CMAKE_WEBKITCOMPILERFLAGS}" DESTINATION "${SOURCE_PATH}/cmake" )
2024-08-09 12:47:30 +08:00
vcpkg_download_distfile ( WK_ANGLE_CMAKE_DETECTSSE2
U R L S " h t t p s : / / g i t h u b . c o m / W e b K i t / W e b K i t / r a w / $ { A N G L E _ W E B K I T _ B U I L D S Y S T E M _ C O M M I T } / S o u r c e / c m a k e / D e t e c t S S E 2 . c m a k e "
F I L E N A M E " D e t e c t S S E 2 . c m a k e "
S H A 5 1 2 2 1 9 a 4 c 8 5 9 1 e e 3 1 d 1 1 e b 3 d 1 e 4 8 0 3 c c 3 c 9 d 4 5 7 3 9 8 4 b b 2 5 e c a c 6 f 2 c 7 6 e 6 a 3 d a b 5 9 8 c 0 0 b 0 1 5 7 d 0 f 9 4 b 1 8 0 1 6 d e 6 7 8 6 e 4 9 d 8 b 2 9 a 1 6 1 6 9 3 a 5 c e 2 3 d 7 6 1 c 8 f e 6 a 7 9 8 c 1 b c a
)
file ( COPY "${WK_ANGLE_CMAKE_DETECTSSE2}" DESTINATION "${SOURCE_PATH}/cmake" )
2023-02-11 03:45:11 +08:00
vcpkg_download_distfile ( WK_ANGLE_CMAKE_WEBKITMACROS
U R L S " h t t p s : / / g i t h u b . c o m / W e b K i t / W e b K i t / r a w / $ { A N G L E _ W E B K I T _ B U I L D S Y S T E M _ C O M M I T } / S o u r c e / c m a k e / W e b K i t M a c r o s . c m a k e "
F I L E N A M E " W e b K i t M a c r o s . c m a k e "
S H A 5 1 2 0 d 1 2 6 b 1 d 1 b 0 c a 9 9 5 c 2 e a 6 e 5 1 c 7 3 3 2 6 d b 3 6 3 f 5 6 0 f 3 f 0 7 9 1 2 c e 5 8 c 7 c 0 2 2 d 9 2 5 7 d 2 7 b 9 6 3 d a c 5 6 a e e 0 e 9 6 0 4 c a 7 a 3 d 7 4 c 5 a a 9 f 0 4 5 1 c 2 4 3 f e c 9 2 2 f b 4 8 5 d d 2 2 5 3 6 8 5 a b 6
)
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 )
2021-07-21 02:56:02 +08:00
if ( EXISTS "${PATH}" )
return ( )
endif ( )
2022-11-09 03:49:29 +08:00
2021-07-21 02:56:02 +08:00
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 } "
)
file ( RENAME "${DEP_SOURCE_PATH}" "${PATH}" )
file ( REMOVE_RECURSE "${DEP_SOURCE_PATH}" )
endfunction ( )
2023-02-11 03:45:11 +08:00
checkout_in_path (
2021-07-21 02:56:02 +08:00
" $ { 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 "
2023-02-11 03:45:11 +08:00
" $ { A N G L E _ T H I R D P A R T Y _ Z L I B _ C O M M I T } "
2021-07-21 02:56:02 +08:00
)
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
2022-11-09 03:49:29 +08:00
" - D $ { A N G L E _ C P U _ B I T N E S S } = 1 "
2023-02-11 03:45:11 +08:00
" - D P O R T = $ { A N G L E _ B U I L D S Y S T E M _ P O R T } "
" - D A N G L E _ U S E _ D 3 D 1 1 _ C O M P O S I T O R _ N A T I V E _ W I N D O W = $ { A N G L E _ U S E _ D 3 D 1 1 _ C O M P O S I T O R _ N A T I V E _ W I N D O W } "
2022-11-09 03:49:29 +08:00
" - D V C P K G _ T A R G E T _ I S _ W I N D O W S = $ { V C P K G _ T A R G E T _ I S _ W I N D O W S } "
2019-05-03 13:57:43 +08:00
)
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
2023-06-22 08:46:47 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" )
# Remove empty directories inside include directory
file ( GLOB directory_children RELATIVE "${CURRENT_PACKAGES_DIR}/include" "${CURRENT_PACKAGES_DIR}/include/*" )
foreach ( directory_child ${ directory_children } )
if ( IS_DIRECTORY "${CURRENT_PACKAGES_DIR}/include/${directory_child}" )
file ( GLOB_RECURSE subdirectory_children "${CURRENT_PACKAGES_DIR}/include/${directory_child}/*" )
if ( "${subdirectory_children}" STREQUAL "" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/${directory_child}" )
endif ( )
2020-04-07 05:49:51 +08:00
endif ( )
endforeach ( )
2023-06-22 08:46:47 +08:00
unset ( subdirectory_children )
unset ( directory_child )
unset ( directory_children )
2023-02-10 02:59:04 +08:00
file ( INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" )