aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/presentmon/CMakeLists.txt73
-rw-r--r--ports/presentmon/portfile.cmake36
-rw-r--r--ports/presentmon/vcpkg.json11
-rw-r--r--versions/baseline.json4
-rw-r--r--versions/p-/presentmon.json9
5 files changed, 133 insertions, 0 deletions
diff --git a/ports/presentmon/CMakeLists.txt b/ports/presentmon/CMakeLists.txt
new file mode 100644
index 000000000..d1ff455fc
--- /dev/null
+++ b/ports/presentmon/CMakeLists.txt
@@ -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() \ No newline at end of file
diff --git a/ports/presentmon/portfile.cmake b/ports/presentmon/portfile.cmake
new file mode 100644
index 000000000..dd55cad5c
--- /dev/null
+++ b/ports/presentmon/portfile.cmake
@@ -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) \ No newline at end of file
diff --git a/ports/presentmon/vcpkg.json b/ports/presentmon/vcpkg.json
new file mode 100644
index 000000000..427249ea0
--- /dev/null
+++ b/ports/presentmon/vcpkg.json
@@ -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"
+ }
+ }
+}
diff --git a/versions/baseline.json b/versions/baseline.json
index 8aa4a9202..a958de7da 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -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
diff --git a/versions/p-/presentmon.json b/versions/p-/presentmon.json
new file mode 100644
index 000000000..185037fbd
--- /dev/null
+++ b/versions/p-/presentmon.json
@@ -0,0 +1,9 @@
+{
+ "versions": [
+ {
+ "git-tree": "581eeeb1e8761811f3393a6cd0e4041609b162d0",
+ "version-string": "1.6.0",
+ "port-version": 0
+ }
+ ]
+}