Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cppwinrt] Update to version 2.0.201008.2 #14092

Merged
merged 5 commits into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions ports/cppwinrt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 3.15)
project(cppwinrt VERSION ${VERSION} LANGUAGES C CXX ASM_MASM)
Link1J marked this conversation as resolved.
Show resolved Hide resolved

if ("${VCPKG_TARGET_ARCHITECTURE}" STREQUAL "x86")
set(VCPKG_TARGET_ARCHITECTURE win32)
endif()

add_library(cppwinrt INTERFACE)
target_include_directories(cppwinrt
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(cppwinrt
INTERFACE
windowsapp.lib
cppwinrt_fast_forwarder.lib
)
target_link_directories(cppwinrt
INTERFACE
$<INSTALL_INTERFACE:lib>
)

install(TARGETS cppwinrt EXPORT cppwinrt)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/winrt TYPE INCLUDE CONFIGURATIONS Release)
install(FILES build/native/lib/${VCPKG_TARGET_ARCHITECTURE}/cppwinrt_fast_forwarder.lib TYPE LIB)
install(EXPORT cppwinrt DESTINATION share/cppwinrt NAMESPACE cppwinrt:: FILE cppwinrtConfig.cmake)
4 changes: 0 additions & 4 deletions ports/cppwinrt/CONTROL

This file was deleted.

40 changes: 24 additions & 16 deletions ports/cppwinrt/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
include(vcpkg_common_functions)
if(NOT VCPKG_TARGET_IS_WINDOWS)
message(FATAL_ERROR "\n${PORT} does not support your system, only Windows for now. Please open a ticket issue on github.com/microsoft/vcpkg if necessary\n")
endif()
Link1J marked this conversation as resolved.
Show resolved Hide resolved

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/cppwinrt
REF fall_2017_creators_update_for_vs_15.3
SHA512 e3f987ed3f3dce019b8bf9f5451e53b42357473a003b8c14f9009e1848ee0463286bd46fdc3c739c8f7c2d232707e8018f5c087ffae784c745d51a8143f9a294
HEAD_REF master
set(PACKAGE_NAME Microsoft.Windows.CppWinRT)
set(VERSION 2.0.201008.2)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src)

vcpkg_find_acquire_program(NUGET)
vcpkg_execute_required_process(
ALLOW_IN_DOWNLOAD_MODE
COMMAND ${NUGET} install ${PACKAGE_NAME} -ExcludeVersion -Version ${VERSION} -NonInteractive -OutputDirectory ${SOURCE_PATH}
Link1J marked this conversation as resolved.
Show resolved Hide resolved
LOGNAME nuget-${TARGET_TRIPLET}
)

# Put the licence file where vcpkg expects it
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/cppwinrt)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/cppwinrt/LICENSE ${CURRENT_PACKAGES_DIR}/share/cppwinrt/copyright)
set(SOURCE_PATH ${SOURCE_PATH}/${PACKAGE_NAME})
Link1J marked this conversation as resolved.
Show resolved Hide resolved

# Copy the cppwinrt header files
file(GLOB HEADER_FILES ${SOURCE_PATH}/10.0.16299.0/winrt/*)
file(
COPY ${HEADER_FILES}
DESTINATION ${CURRENT_PACKAGES_DIR}/include/winrt
REGEX "\.(gitattributes|gitignore)$" EXCLUDE
vcpkg_execute_required_process(
COMMAND ${SOURCE_PATH}/bin/cppwinrt.exe -input sdk -output ${SOURCE_PATH}/include
Link1J marked this conversation as resolved.
Show resolved Hide resolved
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets()

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
7 changes: 7 additions & 0 deletions ports/cppwinrt/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "cppwinrt",
"version-string": "2.0.201008.2",
"description": "C++/WinRT is a standard C++ language projection for the Windows Runtime.",
"homepage": "https://github.com/Microsoft/cppwinrt",
"supports": "!(osx | linux)"
Link1J marked this conversation as resolved.
Show resolved Hide resolved
}