2021-01-12 08:12:01 +08:00
vcpkg_check_linkage ( ONLY_DYNAMIC_CRT )
2021-06-30 07:08:28 +08:00
if ( VCPKG_TARGET_IS_WINDOWS )
2021-01-12 08:12:01 +08:00
set ( VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled ) # some parts of this port can only build as a shared library.
endif ( )
vcpkg_from_gitlab (
G I T L A B _ U R L h t t p s : / / g i t l a b . f r e e d e s k t o p . o r g
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 m e s a / m e s a
2023-10-13 01:46:42 +08:00
R E F m e s a - $ { V E R S I O N }
2024-06-06 16:14:30 +08:00
S H A 5 1 2 2 0 2 b 2 b 2 0 f f e 7 d 3 5 7 5 7 0 a 0 d 0 b f 0 b 5 3 d c 2 4 6 b 3 e 9 0 3 7 3 8 e 8 c 8 a 0 0 0 c 5 f 6 1 1 0 9 a b 5 2 3 3 d 6 2 d e 2 1 7 4 4 4 f 4 9 f d 6 2 9 2 7 f 8 c 4 1 8 d 9 2 9 e 5 a 2 a 5 a 8 0 0 d 1 e 3 9 e 3 3 4 d 5 0 e b 0 9 0 e 8 5 0 c
2022-01-19 07:45:42 +08:00
F I L E _ D I S A M B I G U A T O R 1
2021-06-30 07:08:28 +08:00
H E A D _ R E F m a s t e r
2023-03-31 05:18:52 +08:00
)
2022-04-15 02:08:23 +08:00
2023-10-13 01:46:42 +08:00
x_vcpkg_get_python_packages ( PYTHON_VERSION "3" OUT_PYTHON_VAR "PYTHON3" PACKAGES setuptools mako )
2024-03-12 05:09:15 +08:00
get_filename_component ( PYTHON3_DIR "${PYTHON3}" DIRECTORY )
vcpkg_add_to_path ( PREPEND "${PYTHON3_DIR}" )
2021-01-12 08:12:01 +08:00
vcpkg_find_acquire_program ( FLEX )
2023-10-13 01:46:42 +08:00
get_filename_component ( FLEX_DIR "${FLEX}" DIRECTORY )
2021-01-12 08:12:01 +08:00
vcpkg_add_to_path ( PREPEND "${FLEX_DIR}" )
vcpkg_find_acquire_program ( BISON )
2023-10-13 01:46:42 +08:00
get_filename_component ( BISON_DIR "${BISON}" DIRECTORY )
2021-01-12 08:12:01 +08:00
vcpkg_add_to_path ( PREPEND "${BISON_DIR}" )
2024-06-15 02:40:01 +08:00
if ( CMAKE_HOST_WIN32 ) # WIN32 HOST probably has win_flex and win_bison!
2021-01-12 08:12:01 +08:00
if ( NOT EXISTS "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
if ( FLEX_DIR MATCHES "${DOWNLOADS}" )
file ( CREATE_LINK "${FLEX}" "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
else ( )
message ( FATAL_ERROR "${PORT} requires flex being named flex on windows and not win_flex!\n(Can be solved by creating a simple link from win_flex to flex)" )
endif ( )
endif ( )
if ( NOT EXISTS "${BISON_DIR}/BISON${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
if ( BISON_DIR MATCHES "${DOWNLOADS}" )
file ( CREATE_LINK "${BISON}" "${BISON_DIR}/bison${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
else ( )
message ( FATAL_ERROR "${PORT} requires bison being named bison on windows and not win_bison!\n(Can be solved by creating a simple link from win_bison to bison)" )
endif ( )
endif ( )
endif ( )
# For features https://github.com/pal1000/mesa-dist-win should be probably studied a bit more.
list ( APPEND MESA_OPTIONS -Dzstd=enabled )
list ( APPEND MESA_OPTIONS -Dvalgrind=disabled )
2024-06-06 16:14:30 +08:00
list ( APPEND MESA_OPTIONS -Dshared-llvm=disabled )
list ( APPEND MESA_OPTIONS -Dcpp_rtti=true )
2022-09-09 02:49:08 +08:00
if ( "offscreen" IN_LIST FEATURES )
list ( APPEND MESA_OPTIONS -Dosmesa=true )
else ( )
list ( APPEND MESA_OPTIONS -Dosmesa=false )
endif ( )
2021-01-12 08:12:01 +08:00
if ( "llvm" IN_LIST FEATURES )
list ( APPEND MESA_OPTIONS -Dllvm=enabled )
else ( )
list ( APPEND MESA_OPTIONS -Dllvm=disabled )
endif ( )
2024-06-06 16:14:30 +08:00
set ( use_gles OFF )
2021-01-12 08:12:01 +08:00
if ( "gles1" IN_LIST FEATURES )
list ( APPEND MESA_OPTIONS -Dgles1=enabled )
2024-06-06 16:14:30 +08:00
set ( use_gles ON )
2021-01-12 08:12:01 +08:00
else ( )
list ( APPEND MESA_OPTIONS -Dgles1=disabled )
endif ( )
if ( "gles2" IN_LIST FEATURES )
list ( APPEND MESA_OPTIONS -Dgles2=enabled )
2024-06-06 16:14:30 +08:00
set ( use_gles ON )
2021-01-12 08:12:01 +08:00
else ( )
list ( APPEND MESA_OPTIONS -Dgles2=disabled )
endif ( )
2024-06-06 16:14:30 +08:00
if ( use_gles )
list ( APPEND MESA_OPTIONS -Dshared-glapi=enabled ) # shared GLAPI required when building two or more of the following APIs - gles1 gles2
2021-01-12 08:12:01 +08:00
else ( )
2024-06-06 16:14:30 +08:00
list ( APPEND MESA_OPTIONS -Dshared-glapi=auto )
2021-01-12 08:12:01 +08:00
endif ( )
2024-06-06 16:14:30 +08:00
if ( "egl" IN_LIST FEATURES )
2021-01-12 08:12:01 +08:00
list ( APPEND MESA_OPTIONS -Degl=enabled )
else ( )
list ( APPEND MESA_OPTIONS -Degl=disabled )
endif ( )
if ( VCPKG_TARGET_IS_WINDOWS )
list ( APPEND MESA_OPTIONS -Dplatforms=['windows'] )
2021-06-30 07:08:28 +08:00
list ( APPEND MESA_OPTIONS -Dmicrosoft-clc=disabled )
2022-05-17 02:41:53 +08:00
if ( NOT VCPKG_TARGET_IS_MINGW )
set ( VCPKG_CXX_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_CXX_FLAGS}" )
set ( VCPKG_C_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_C_FLAGS}" )
endif ( )
2021-01-12 08:12:01 +08:00
endif ( )
2022-05-17 02:41:53 +08:00
2021-01-12 08:12:01 +08:00
vcpkg_configure_meson (
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
O P T I O N S
2021-01-23 02:27:34 +08:00
- D g l e s - l i b - s u f f i x = _ m e s a
2021-01-12 08:12:01 +08:00
- D b u i l d - t e s t s = f a l s e
$ { M E S A _ O P T I O N S }
2024-03-12 05:09:15 +08:00
A D D I T I O N A L _ B I N A R I E S
2024-06-06 16:14:30 +08:00
p y t h o n = [ ' $ { P Y T H O N 3 } ' , ' - I ' ]
p y t h o n 3 = [ ' $ { P Y T H O N 3 } ' , ' - I ' ]
)
2021-01-12 08:12:01 +08:00
vcpkg_install_meson ( )
vcpkg_fixup_pkgconfig ( )
2023-01-12 15:04:26 +08:00
file ( REMOVE_RECURSE
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / i n c l u d e "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / s h a r e "
# installed by egl-registry
" $ { C U R R E N T _ P A C K A G E S _ D I R } / i n c l u d e / K H R "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / i n c l u d e / E G L "
# installed by opengl-registry
" $ { C U R R E N T _ P A C K A G E S _ D I R } / i n c l u d e / G L "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / i n c l u d e / G L E S "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / i n c l u d e / G L E S 2 "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / i n c l u d e / G L E S 3 "
)
file ( GLOB remaining "${CURRENT_PACKAGES_DIR}/include/*" )
if ( NOT remaining )
# All headers to be provided by egl-registry and/or opengl-registry
set ( VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include" )
endif ( )
if ( VCPKG_TARGET_IS_WINDOWS )
# opengl32.lib is already installed by port opengl.
# Mesa claims to provide a drop-in replacement of opengl32.dll.
file ( MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/manual-link" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/lib/opengl32.lib" "${CURRENT_PACKAGES_DIR}/lib/manual-link/opengl32.lib" )
if ( NOT VCPKG_BUILD_TYPE )
file ( MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/opengl32.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/opengl32.lib" )
endif ( )
endif ( )
2023-04-26 14:17:36 +08:00
if ( FEATURES STREQUAL "core" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" )
endif ( )
2023-01-12 15:04:26 +08:00
vcpkg_install_copyright ( FILE_LIST "${SOURCE_PATH}/docs/license.rst" )