mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-19 05:53:03 +08:00
Port for PresentMon, windows-only ETW swap-chain presentation capture and analysis tool (#16628)
* Port for presentmon, a windows-only tool * run x-add-version * Add expected failures to ci file for presentmon port * Update scripts/ci.baseline.txt Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Update ports/presentmon/vcpkg.json Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Update versions/p-/presentmon.json Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * CMake-based port for presentmon, based on source provided by JackBoosY * Rerun x-add-version Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
This commit is contained in:
parent
b4c067ed7d
commit
c90db9a65e
73
ports/presentmon/CMakeLists.txt
Normal file
73
ports/presentmon/CMakeLists.txt
Normal file
@ -0,0 +1,73 @@
|
||||
cmake_minimum_required(VERSION 3.11)
|
||||
project(presentmon)
|
||||
|
||||
set(PRESENTMON_VERSION 1.6.0)
|
||||
|
||||
option(INSTALL_HEADERS "Install presentmon headers" ON)
|
||||
option(BUILD_TOOLS "Build tool PresentMon" OFF)
|
||||
|
||||
set(PRESENTDATA_SRCS
|
||||
PresentData/Debug.cpp
|
||||
PresentData/MixedRealityTraceConsumer.cpp
|
||||
PresentData/PresentMonTraceConsumer.cpp
|
||||
PresentData/TraceConsumer.cpp
|
||||
PresentData/TraceSession.cpp
|
||||
)
|
||||
|
||||
set(PRESENTDATA_HDRS
|
||||
PresentData/Debug.hpp
|
||||
PresentData/MixedRealityTraceConsumer.hpp
|
||||
PresentData/PresentMonTraceConsumer.hpp
|
||||
PresentData/TraceConsumer.hpp
|
||||
PresentData/TraceSession.hpp
|
||||
${CMAKE_BINARY_DIR}/generated/version.h
|
||||
)
|
||||
|
||||
|
||||
file(GLOB EXTRA_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/PresentData/ETW/*.h)
|
||||
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/generated/version.h "char const* PRESENT_MON_VERSION = \"1.6.0\";")
|
||||
|
||||
add_library(PresentData STATIC ${PRESENTDATA_SRCS} ${PRESENTDATA_HDRS} ${EXTRA_INCLUDES})
|
||||
|
||||
target_include_directories(PresentData PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/PresentData>
|
||||
$<INSTALL_INTERFACE:include/presentmon>
|
||||
)
|
||||
target_compile_definitions(PresentData PRIVATE UNICODE)
|
||||
|
||||
# Install targets
|
||||
install(TARGETS PresentData
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
|
||||
if (BUILD_TOOLS)
|
||||
set(PresentMon_SRCS
|
||||
PresentMon/CommandLine.cpp
|
||||
PresentMon/Console.cpp
|
||||
PresentMon/ConsumerThread.cpp
|
||||
PresentMon/CsvOutput.cpp
|
||||
PresentMon/LateStageReprojectionData.cpp
|
||||
PresentMon/MainThread.cpp
|
||||
PresentMon/OutputThread.cpp
|
||||
PresentMon/Privilege.cpp
|
||||
PresentMon/TraceSession.cpp
|
||||
)
|
||||
|
||||
add_executable(PresentMon ${PresentMon_SRCS})
|
||||
target_include_directories(PresentMon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/PresentMon ${CMAKE_BINARY_DIR})
|
||||
target_compile_definitions(PresentMon PRIVATE UNICODE)
|
||||
target_link_libraries(PresentMon PRIVATE PresentData Tdh Shlwapi)
|
||||
|
||||
install(TARGETS PresentMon
|
||||
RUNTIME DESTINATION bin
|
||||
)
|
||||
endif()
|
||||
|
||||
# Install headers
|
||||
if (INSTALL_HEADERS)
|
||||
install(FILES ${PRESENTDATA_HDRS} DESTINATION include/presentmon)
|
||||
install(FILES ${EXTRA_INCLUDES} DESTINATION include/presentmon/ETW)
|
||||
endif()
|
36
ports/presentmon/portfile.cmake
Normal file
36
ports/presentmon/portfile.cmake
Normal file
@ -0,0 +1,36 @@
|
||||
# The upstream doesn't export any symbols
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
vcpkg_fail_port_install(ON_TARGET "linux" "osx" "uwp" "ios" "android" "freebsd")
|
||||
|
||||
set(PRESENTMON_VERSION 1.6.0)
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO GameTechDev/PresentMon
|
||||
REF 6ddc9e15d2ef169cdce954b589c1ba190b3a25bd # 1.6.0
|
||||
SHA512 2522b0e3218d4a6588531a09bc82631f14ad05c20f4560fe0574f00f2f5eece114ae04320f920eb52ba64173cea5cdf15bb223b7395c3782e4a6465afb5d9bec
|
||||
HEAD_REF main
|
||||
)
|
||||
|
||||
file(COPY ${CURRENT_PORT_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
tools BUILD_TOOLS
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS ${FEATURE_OPTIONS}
|
||||
OPTIONS_DEBUG
|
||||
-DINSTALL_HEADERS=OFF
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
if("tools" IN_LIST FEATURES)
|
||||
vcpkg_copy_tools(TOOL_NAMES presentmon AUTO_CLEAN)
|
||||
endif()
|
||||
|
||||
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
11
ports/presentmon/vcpkg.json
Normal file
11
ports/presentmon/vcpkg.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "presentmon",
|
||||
"version-string": "1.6.0",
|
||||
"description": "PresentMon is a tool to capture and analyze ETW events related to swap chain presentation on Windows.",
|
||||
"supports": "windows & !uwp",
|
||||
"features": {
|
||||
"tools": {
|
||||
"description": "Build tool PresentMon"
|
||||
}
|
||||
}
|
||||
}
|
@ -4848,6 +4848,10 @@
|
||||
"baseline": "1.3-4",
|
||||
"port-version": 0
|
||||
},
|
||||
"presentmon": {
|
||||
"baseline": "1.6.0",
|
||||
"port-version": 0
|
||||
},
|
||||
"proj": {
|
||||
"baseline": "0",
|
||||
"port-version": 0
|
||||
|
9
versions/p-/presentmon.json
Normal file
9
versions/p-/presentmon.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "581eeeb1e8761811f3393a6cd0e4041609b162d0",
|
||||
"version-string": "1.6.0",
|
||||
"port-version": 0
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user