diff --git a/ports/glfw3/glfw3Config.cmake b/ports/glfw3/glfw3Config.cmake new file mode 100644 index 0000000000..71153f63f5 --- /dev/null +++ b/ports/glfw3/glfw3Config.cmake @@ -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() diff --git a/ports/glfw3/portfile.cmake b/ports/glfw3/portfile.cmake index 4c25062606..fb5bfa193f 100644 --- a/ports/glfw3/portfile.cmake +++ b/ports/glfw3/portfile.cmake @@ -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( OUT_SOURCE_PATH SOURCE_PATH 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: 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() vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -44,6 +42,8 @@ vcpkg_cmake_configure( -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF ${FEATURE_OPTIONS} + MAYBE_UNUSED_VARIABLES + GLFW_USE_WAYLAND ) vcpkg_cmake_install() @@ -54,6 +54,4 @@ vcpkg_fixup_pkgconfig() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) - -vcpkg_copy_pdbs() +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md") diff --git a/ports/glfw3/vcpkg.json b/ports/glfw3/vcpkg.json index eefd66efb6..14c4fcd542 100644 --- a/ports/glfw3/vcpkg.json +++ b/ports/glfw3/vcpkg.json @@ -1,6 +1,7 @@ { "name": "glfw3", "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.", "homepage": "https://github.com/glfw/glfw", "license": "Zlib", diff --git a/versions/baseline.json b/versions/baseline.json index 0574c35958..b3ef09a9f2 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3102,7 +3102,7 @@ }, "glfw3": { "baseline": "3.4", - "port-version": 0 + "port-version": 1 }, "gli": { "baseline": "2021-07-06", diff --git a/versions/g-/glfw3.json b/versions/g-/glfw3.json index 4e41251756..d010f0b1a7 100644 --- a/versions/g-/glfw3.json +++ b/versions/g-/glfw3.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "d4bbd4f27c2ca619f57778985120cddcedadb1cc", + "version": "3.4", + "port-version": 1 + }, { "git-tree": "fcbaa3b4073da7a24e20e043164075512f027d2d", "version": "3.4",