[discord-rpc] Add v2.0.1

- Not properly configured for debug builds and always forced /MT. Fixed by patching cmake.
- Unable to stop building of examples, so delete afterwards.
This commit is contained in:
Ted John 2017-11-11 18:46:05 +00:00
parent 50f6bc4e8f
commit e57d38a812
3 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,3 @@
Source: discord-rpc
Version: 2.0.1
Description: Rich Presence allows you to leverage the totally overhauled "Now Playing" section in a Discord user's profile to help people play your game together.

View File

@ -0,0 +1,24 @@
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -30,7 +30,6 @@ if(WIN32)
set(BASE_RPC_SRC ${BASE_RPC_SRC} connection_win.cpp discord_register_win.cpp)
add_library(discord-rpc ${RPC_LIBRARY_TYPE} ${BASE_RPC_SRC})
target_compile_options(discord-rpc PRIVATE /EHsc
- /MT
/Wall
/wd4100 # unreferenced formal parameter
/wd4514 # unreferenced inline
@@ -102,13 +101,10 @@ install(
EXPORT "discord-rpc"
RUNTIME
DESTINATION "bin"
- CONFIGURATIONS Release
LIBRARY
DESTINATION "lib"
- CONFIGURATIONS Release
ARCHIVE
DESTINATION "lib"
- CONFIGURATIONS Release
INCLUDES
DESTINATION "include"
)

View File

@ -0,0 +1,45 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO discordapp/discord-rpc
REF v2.0.1
SHA512 496f8f34184c4be3c3341b05ebd440a9e89e36ecf15747ea8f4d1cc0404f1341404fda6c8358a2c08e0149023775472ea78603b9d41687f1004828523debda99
HEAD_REF master
)
vcpkg_apply_patches(
SOURCE_PATH
${SOURCE_PATH}
PATCHES
${CMAKE_CURRENT_LIST_DIR}/fix-debug.diff
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(BUILD_DYNAMIC_LIB ON)
else()
set(BUILD_DYNAMIC_LIB OFF)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DBUILD_DYNAMIC_LIB=${BUILD_DYNAMIC_LIB}
)
vcpkg_install_cmake()
# Remove bin and debug include
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin
${CURRENT_PACKAGES_DIR}/debug/bin)
else()
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/send-presence.exe
${CURRENT_PACKAGES_DIR}/debug/bin/send-presence.exe)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Copy copright information
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/discord-rpc" RENAME "copyright")
vcpkg_copy_pdbs()