mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-24 02:41:47 +08:00
[glfw3] Fix build on wasm32-emscripten (#39959)
This commit is contained in:
parent
91d888703f
commit
110c50d470
6
ports/glfw3/glfw3Config.cmake
Normal file
6
ports/glfw3/glfw3Config.cmake
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
if (NOT TARGET glfw)
|
||||||
|
add_library(glfw INTERFACE IMPORTED)
|
||||||
|
set_target_properties(glfw PROPERTIES
|
||||||
|
INTERFACE_LINK_OPTIONS "-sUSE_GLFW=3"
|
||||||
|
)
|
||||||
|
endif()
|
@ -1,3 +1,11 @@
|
|||||||
|
if (VCPKG_TARGET_IS_EMSCRIPTEN)
|
||||||
|
# emscripten has built-in glfw3 library
|
||||||
|
set(VCPKG_BUILD_TYPE release)
|
||||||
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/glfw3Config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/glfw3")
|
||||||
|
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
vcpkg_from_github(
|
vcpkg_from_github(
|
||||||
OUT_SOURCE_PATH SOURCE_PATH
|
OUT_SOURCE_PATH SOURCE_PATH
|
||||||
REPO glfw/glfw
|
REPO glfw/glfw
|
||||||
@ -20,16 +28,6 @@ These can be installed on Ubuntu systems via sudo apt install libxinerama-dev li
|
|||||||
Alternatively, when targeting the Wayland display server, use the packages listed in the GLFW documentation here:
|
Alternatively, when targeting the Wayland display server, use the packages listed in the GLFW documentation here:
|
||||||
|
|
||||||
https://www.glfw.org/docs/3.3/compile.html#compile_deps_wayland")
|
https://www.glfw.org/docs/3.3/compile.html#compile_deps_wayland")
|
||||||
else(VCPKG_TARGET_IS_OSX)
|
|
||||||
message(
|
|
||||||
"GLFW3 currently requires the following libraries from the system package manager:
|
|
||||||
xinerama
|
|
||||||
xcursor
|
|
||||||
xorg
|
|
||||||
libglu1-mesa
|
|
||||||
pkg-config
|
|
||||||
|
|
||||||
These can be installed via brew install libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev pkg-config")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||||
@ -44,6 +42,8 @@ vcpkg_cmake_configure(
|
|||||||
-DGLFW_BUILD_TESTS=OFF
|
-DGLFW_BUILD_TESTS=OFF
|
||||||
-DGLFW_BUILD_DOCS=OFF
|
-DGLFW_BUILD_DOCS=OFF
|
||||||
${FEATURE_OPTIONS}
|
${FEATURE_OPTIONS}
|
||||||
|
MAYBE_UNUSED_VARIABLES
|
||||||
|
GLFW_USE_WAYLAND
|
||||||
)
|
)
|
||||||
|
|
||||||
vcpkg_cmake_install()
|
vcpkg_cmake_install()
|
||||||
@ -54,6 +54,4 @@ vcpkg_fixup_pkgconfig()
|
|||||||
|
|
||||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||||
|
|
||||||
file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md")
|
||||||
|
|
||||||
vcpkg_copy_pdbs()
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "glfw3",
|
"name": "glfw3",
|
||||||
"version": "3.4",
|
"version": "3.4",
|
||||||
|
"port-version": 1,
|
||||||
"description": "GLFW is a free, Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan application development. It provides a simple, platform-independent API for creating windows, contexts and surfaces, reading input, handling events, etc.",
|
"description": "GLFW is a free, Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan application development. It provides a simple, platform-independent API for creating windows, contexts and surfaces, reading input, handling events, etc.",
|
||||||
"homepage": "https://github.com/glfw/glfw",
|
"homepage": "https://github.com/glfw/glfw",
|
||||||
"license": "Zlib",
|
"license": "Zlib",
|
||||||
|
@ -3102,7 +3102,7 @@
|
|||||||
},
|
},
|
||||||
"glfw3": {
|
"glfw3": {
|
||||||
"baseline": "3.4",
|
"baseline": "3.4",
|
||||||
"port-version": 0
|
"port-version": 1
|
||||||
},
|
},
|
||||||
"gli": {
|
"gli": {
|
||||||
"baseline": "2021-07-06",
|
"baseline": "2021-07-06",
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"versions": [
|
"versions": [
|
||||||
|
{
|
||||||
|
"git-tree": "d4bbd4f27c2ca619f57778985120cddcedadb1cc",
|
||||||
|
"version": "3.4",
|
||||||
|
"port-version": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"git-tree": "fcbaa3b4073da7a24e20e043164075512f027d2d",
|
"git-tree": "fcbaa3b4073da7a24e20e043164075512f027d2d",
|
||||||
"version": "3.4",
|
"version": "3.4",
|
||||||
|
Loading…
Reference in New Issue
Block a user