mirror of https://github.com/microsoft/vcpkg.git
[gainput] Support Linux (#23219)
* [gainput] Support Linux * version * update patch to fix osx build issues * version
This commit is contained in:
parent
5cf60186a2
commit
c45b418ed8
|
|
@ -0,0 +1,44 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index a443b66..61ff7b8 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -9,11 +9,11 @@ option(GAINPUT_TESTS "Build Tests for Gainput" ON)
|
||||
option(GAINPUT_BUILD_SHARED "BUILD_SHARED" ON)
|
||||
option(GAINPUT_BUILD_STATIC "BUILD_STATIC" ON)
|
||||
|
||||
-if(!WIN32)
|
||||
+if(NOT WIN32)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra")
|
||||
else()
|
||||
set(XINPUT "Xinput9_1_0")
|
||||
- if ( ${CMAKE_SYSTEM_VERSION} LESS 6.1 )
|
||||
+ if ( ${CMAKE_SYSTEM_VERSION} VERSION_LESS 6.1 )
|
||||
set(XINPUT, "xinput")
|
||||
endif()
|
||||
endif()
|
||||
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
|
||||
index cb7232f..a6ae3d9 100644
|
||||
--- a/lib/CMakeLists.txt
|
||||
+++ b/lib/CMakeLists.txt
|
||||
@@ -55,15 +55,21 @@ elseif(APPLE)
|
||||
find_library(FOUNDATION Foundation)
|
||||
find_library(IOKIT IOKit)
|
||||
find_library(GAME_CONTROLLER GameController)
|
||||
+ if (GAINPUT_BUILD_SHARED)
|
||||
target_link_libraries(gainput ${FOUNDATION} ${IOKIT} ${GAME_CONTROLLER})
|
||||
+ endif()
|
||||
if(IOS)
|
||||
find_library(UIKIT UIKit)
|
||||
find_library(COREMOTION CoreMotion)
|
||||
find_library(QUARTZCORE QuartzCore)
|
||||
+ if (GAINPUT_BUILD_SHARED)
|
||||
target_link_libraries(gainput ${UIKIT} ${COREMOTION})
|
||||
+ endif()
|
||||
else()
|
||||
find_library(APPKIT AppKit)
|
||||
+ if (GAINPUT_BUILD_SHARED)
|
||||
target_link_libraries(gainput ${APPKIT})
|
||||
+ endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
@ -1,3 +1,7 @@
|
|||
if (VCPKG_TARGET_IS_OSX)
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
endif()
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO jkuhlmann/gainput
|
||||
|
|
@ -5,23 +9,15 @@ vcpkg_from_github(
|
|||
SHA512 56fdc4c0613d7260861885b270ebe9e624e940175f41e3ac82516e2eb0d6d229e405fbcc2e54608e7d6751c1d8658b5b5e186153193badc6487274cb284a8cd6
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
"install_as_cmake_package.patch"
|
||||
install_as_cmake_package.patch
|
||||
fix-build.patch
|
||||
)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
set(GAINPUT_BUILD_SHARED OFF)
|
||||
set(GAINPUT_BUILD_STATIC ON)
|
||||
else()
|
||||
set(GAINPUT_BUILD_SHARED ON)
|
||||
set(GAINPUT_BUILD_STATIC OFF)
|
||||
endif()
|
||||
if(APPLE)
|
||||
set(GAINPUT_BUILD_SHARED ON)
|
||||
endif()
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" GAINPUT_BUILD_STATIC)
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" GAINPUT_BUILD_SHARED)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DGAINPUT_BUILD_SHARED=${GAINPUT_BUILD_SHARED}
|
||||
-DGAINPUT_BUILD_STATIC=${GAINPUT_BUILD_STATIC}
|
||||
|
|
@ -29,9 +25,10 @@ vcpkg_configure_cmake(
|
|||
-DGAINPUT_SAMPLES=OFF
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-gainput TARGET_PATH share/unofficial-gainput)
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-gainput CONFIG_PATH share/unofficial-gainput)
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,19 @@
|
|||
{
|
||||
"name": "gainput",
|
||||
"version-string": "1.0.0",
|
||||
"port-version": 4,
|
||||
"version": "1.0.0",
|
||||
"port-version": 5,
|
||||
"description": "Gainput is a multiplatform C++ input library, supporting mouse, keyboard and controllers",
|
||||
"homepage": "https://github.com/jkuhlmann/gainput"
|
||||
"homepage": "https://github.com/jkuhlmann/gainput",
|
||||
"license": "MIT",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -294,9 +294,6 @@ fuzzylite:arm-uwp=fail
|
|||
fuzzylite:x64-linux=fail
|
||||
fuzzylite:x64-osx=fail
|
||||
fuzzylite:x64-uwp=fail
|
||||
gainput:arm-uwp=fail
|
||||
gainput:x64-linux=fail
|
||||
gainput:x64-uwp=fail
|
||||
|
||||
# Requires ATL for ARM64 to be installed in CI
|
||||
gdal:arm64-windows=fail
|
||||
|
|
|
|||
|
|
@ -2350,7 +2350,7 @@
|
|||
},
|
||||
"gainput": {
|
||||
"baseline": "1.0.0",
|
||||
"port-version": 4
|
||||
"port-version": 5
|
||||
},
|
||||
"gamedev-framework": {
|
||||
"baseline": "0.20.0",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "6edb146db254b1cec192c12f335bef0e54455770",
|
||||
"version": "1.0.0",
|
||||
"port-version": 5
|
||||
},
|
||||
{
|
||||
"git-tree": "8751b5a093ee68d0273600efc1ecfcd23056aa47",
|
||||
"version-string": "1.0.0",
|
||||
|
|
|
|||
Loading…
Reference in New Issue