-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cppwinrt] Update port for January 2024 release (#37452)
This updates the cppwinrt port to use the latest Microsoft.Windows.CppWinRT package from NuGet. Includes clean up of the portfile for modern best practices. This also cleans up the cmake integration: * Uses `cppwinrt_FOUND` instead of the nonstandard `CppWinRT_FOUND` * Provides `CPPWINRT_TOOL` for being able to generate C++/WinRT headers from .winmd files as custom commands
- Loading branch information
Showing
7 changed files
with
50 additions
and
30 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
get_filename_component(_cppwinrt_root "${CMAKE_CURRENT_LIST_DIR}" PATH) | ||
get_filename_component(_cppwinrt_root "${_cppwinrt_root}" PATH) | ||
|
||
set(_cppwinrt_exe "${_cppwinrt_root}/@tool_path@") | ||
if (EXISTS "${_cppwinrt_exe}") | ||
|
||
add_library(Microsoft::CppWinRT INTERFACE IMPORTED) | ||
set_target_properties(Microsoft::CppWinRT PROPERTIES | ||
INTERFACE_COMPILE_FEATURES cxx_std_17 | ||
INTERFACE_INCLUDE_DIRECTORIES "${_cppwinrt_root}/include" | ||
INTERFACE_LINK_LIBRARIES "${_cppwinrt_root}/lib/@lib_name@" | ||
) | ||
|
||
set(cppwinrt_FOUND TRUE) | ||
set(CPPWINRT_TOOL ${_cppwinrt_exe}) | ||
|
||
else() | ||
|
||
set(cppwinrt_FOUND FALSE) | ||
|
||
endif() | ||
|
||
unset(_cppwinrt_root) | ||
unset(_cppwinrt_exe) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
cppwinrt provides CMake targets: | ||
The C++/WinRT package provides CMake targets: | ||
|
||
find_package(cppwinrt CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE Microsoft::CppWinRT) | ||
|
||
The CMake variable CPPWINRT_TOOL is also set to point to the .winmd to header command-line tool. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters