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-03-31 05:18:52 +08:00
R E F b 5 9 0 f d 1 9 5 1 a 1 9 4 9 e 5 f e 2 b b f d 6 1 f 0 8 1 4 c 4 0 2 a f 2 6 3 # mesa-23.0.1
S H A 5 1 2 7 a 6 6 a 5 8 7 e f 0 1 f b 5 8 b 5 1 f 3 e b e a 5 8 4 b 4 0 f 7 0 1 1 4 8 4 4 4 8 4 d f 5 2 8 d 3 8 a d 1 c a a 0 7 1 f a c 7 d 6 e 2 3 f 1 e d 8 0 3 0 9 8 4 7 f 7 e 2 8 4 6 8 0 7 1 5 7 1 2 9 4 b b 8 8 1 2 a 9 8 8 2 c 0 b 8 6 c 8 9 c f 5 a 4 1 4 4 f e 9
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
x_vcpkg_get_python_packages ( PYTHON_VERSION "3" OUT_PYTHON_VAR "PYTHON3" PACKAGES setuptools mako )
2021-01-12 08:12:01 +08:00
vcpkg_find_acquire_program ( FLEX )
get_filename_component ( FLEX_DIR "${FLEX}" DIRECTORY )
vcpkg_add_to_path ( PREPEND "${FLEX_DIR}" )
vcpkg_find_acquire_program ( BISON )
get_filename_component ( BISON_DIR "${BISON}" DIRECTORY )
vcpkg_add_to_path ( PREPEND "${BISON_DIR}" )
if ( WIN32 ) # WIN32 HOST probably has win_flex and win_bison!
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 -Dshared-llvm=auto )
list ( APPEND MESA_OPTIONS -Dlibunwind=disabled )
list ( APPEND MESA_OPTIONS -Dlmsensors=disabled )
list ( APPEND MESA_OPTIONS -Dvalgrind=disabled )
list ( APPEND MESA_OPTIONS -Dglvnd=false )
list ( APPEND MESA_OPTIONS -Dglx=disabled )
list ( APPEND MESA_OPTIONS -Dgbm=disabled )
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 ( )
if ( "gles1" IN_LIST FEATURES )
list ( APPEND MESA_OPTIONS -Dgles1=enabled )
else ( )
list ( APPEND MESA_OPTIONS -Dgles1=disabled )
endif ( )
if ( "gles2" IN_LIST FEATURES )
list ( APPEND MESA_OPTIONS -Dgles2=enabled )
else ( )
list ( APPEND MESA_OPTIONS -Dgles2=disabled )
endif ( )
if ( "opengl" IN_LIST FEATURES )
list ( APPEND MESA_OPTIONS -Dopengl=true )
else ( )
list ( APPEND MESA_OPTIONS -Dopengl=false )
endif ( )
if ( "egl" IN_LIST FEATURES ) # EGL feature only works on Linux
list ( APPEND MESA_OPTIONS -Degl=enabled )
else ( )
list ( APPEND MESA_OPTIONS -Degl=disabled )
endif ( )
list ( APPEND MESA_OPTIONS -Dshared-glapi=enabled ) #shared GLAPI required when building two or more of the following APIs - opengl, gles1 gles2
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 egl-lib-suffix=_mesa
- 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 }
)
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 ( )
vcpkg_install_copyright ( FILE_LIST "${SOURCE_PATH}/docs/license.rst" )