-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from crud89/pix-port-update
Use open source PIX runtime instead of NuGet pre-build.
- Loading branch information
Showing
18 changed files
with
192 additions
and
119 deletions.
There are no files selected for viewing
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
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
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
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
64 changes: 64 additions & 0 deletions
64
src/Modules/overlay-ports/winpixeventruntime/CMakeLists.txt
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,64 @@ | ||
cmake_minimum_required(VERSION 3.20) | ||
project(WinPixEventRuntime LANGUAGES CXX) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
# Run message compiler for ETW manifest. | ||
# Note: this naturally requries msvc toolset. | ||
add_custom_target(PixEtw | ||
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_SOURCE_DIR}/intermediates/" | ||
COMMAND mc "${CMAKE_SOURCE_DIR}/runtime/lib/PixEtw.man" -um -P ETW_EVENT -r "${CMAKE_SOURCE_DIR}/intermediates/" -h "${CMAKE_SOURCE_DIR}/intermediates/" | ||
) | ||
|
||
# Define library project | ||
add_library(WinPixEventRuntimeLib STATIC | ||
"runtime/lib/BlockAllocator.h" | ||
"runtime/lib/pch.h" | ||
"runtime/lib/ThreadData.h" | ||
"runtime/lib/ThreadedWorker.h" | ||
"runtime/lib/Threads.h" | ||
"runtime/lib/WinPixEventRuntime.h" | ||
"runtime/lib/Worker.h" | ||
|
||
"runtime/lib/BlockAllocator.cpp" | ||
"runtime/lib/ThreadData.cpp" | ||
"runtime/lib/ThreadedWorker.cpp" | ||
"runtime/lib/Threads.cpp" | ||
"runtime/lib/WinPixEventRuntime.cpp" | ||
"runtime/lib/pch.cpp" | ||
|
||
"runtime/lib/PixEtw.man" | ||
) | ||
|
||
# TODO: Use vcpkg to resolve WIL. | ||
target_include_directories(WinPixEventRuntimeLib | ||
PUBLIC "include/" | ||
PRIVATE "intermediates/" "third_party/wil/include/" "${CMAKE_SOURCE_DIR}/" | ||
) | ||
target_precompile_headers(WinPixEventRuntimeLib PRIVATE "runtime/lib/pch.h") | ||
target_compile_definitions(WinPixEventRuntimeLib PUBLIC "USE_PIX" "USE_PIX_ON_ALL_ARCHITECTURES") # TODO: For DEBUG builds, define DBG macro. | ||
add_dependencies(WinPixEventRuntimeLib PixEtw) | ||
|
||
# Define dynamic runtime library. | ||
add_library(WinPixEventRuntime SHARED | ||
"runtime/dll/desktop/WinPixEventRuntime.def" | ||
|
||
"runtime/dll/shared/WinPixEventRuntime.shared.cpp" | ||
"runtime/dll/shared/WinDllMain.cpp" | ||
) | ||
|
||
target_link_libraries(WinPixEventRuntime PRIVATE WinPixEventRuntimeLib) | ||
target_include_directories(WinPixEventRuntime | ||
PUBLIC "$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include/>" "$<INSTALL_INTERFACE:include/>" | ||
PRIVATE "runtime/" "intermediates/" "third_party/wil/include/" "${CMAKE_SOURCE_DIR}/" | ||
) | ||
|
||
set_target_properties(WinPixEventRuntime PROPERTIES | ||
PUBLIC_HEADER "include/PIXEvents.h;include/PIXEventsCommon.h;include/PIXEventsLegacy.h;include/pix3.h;include/pix3_win.h" | ||
) | ||
|
||
# Define install targets. | ||
install(TARGETS WinPixEventRuntime EXPORT WinPixEventRuntime) | ||
export(TARGETS WinPixEventRuntime NAMESPACE Microsoft:: FILE WinPixEventRuntimeConfig.cmake) | ||
install(EXPORT WinPixEventRuntime DESTINATION "${CMAKE_INSTALL_PREFIX}/share/cmake" NAMESPACE Microsoft:: FILE WinPixEventRuntimeConfig.cmake) |
41 changes: 16 additions & 25 deletions
41
src/Modules/overlay-ports/winpixeventruntime/portfile.cmake
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,30 +1,21 @@ | ||
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION} | ||
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) | ||
|
||
vcpkg_download_distfile(ARCHIVE | ||
URLS "https://www.nuget.org/api/v2/package/WinPixEventRuntime/${VERSION}" | ||
FILENAME "winpixeventruntime.${VERSION}.zip" | ||
SHA512 f33d55a8bb731e404370f75756fd41470b5c4eda12f18f5642cdda8d6bde054ea7aa4e78b6074a0fcb707bd5f026ec75d0245bb2328ec9f93fdfaffde4fdcf09 | ||
) | ||
|
||
vcpkg_extract_source_archive( | ||
PACKAGE_PATH | ||
ARCHIVE ${ARCHIVE} | ||
NO_REMOVE_ONE_LEVEL | ||
set(VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled) | ||
|
||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO Microsoft/PixEvents | ||
REF 3a7e70dde7bf54f02f9d2e9dd6d3350c6cfb962f | ||
SHA512 91b7a2f8c83d8e848ec89866e8f30092a1e49f5d327fd5dd972bdb6f8848cef28fd135f6304df0811241a95f379089853edf98c451dc680fc6d7838a8be8edd1 | ||
HEAD_REF main | ||
PATCHES win32compat.patch | ||
) | ||
|
||
file(INSTALL "${PACKAGE_PATH}/include/WinPixEventRuntime/pix3.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include") | ||
file(INSTALL "${PACKAGE_PATH}/include/WinPixEventRuntime/pix3_win.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include") | ||
file(INSTALL "${PACKAGE_PATH}/include/WinPixEventRuntime/PIXEvents.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include") | ||
file(INSTALL "${PACKAGE_PATH}/include/WinPixEventRuntime/PIXEventsCommon.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include") | ||
|
||
file(INSTALL "${PACKAGE_PATH}/bin/${VCPKG_TARGET_ARCHITECTURE}/WinPixEventRuntime.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") | ||
|
||
file(COPY "${PACKAGE_PATH}/bin/${VCPKG_TARGET_ARCHITECTURE}/WinPixEventRuntime.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin") | ||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) | ||
|
||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug") | ||
file(COPY "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug") | ||
vcpkg_cmake_configure(SOURCE_PATH ${SOURCE_PATH}) | ||
vcpkg_cmake_install() | ||
vcpkg_cmake_config_fixup(CONFIG_PATH share/cmake/) | ||
|
||
file(INSTALL "${PACKAGE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
|
||
configure_file("${CMAKE_CURRENT_LIST_DIR}/winpixeventruntime-config.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config.cmake" COPYONLY) | ||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") |
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,4 @@ | ||
The package WinPixEventRuntime provides CMake targets: | ||
|
||
find_package(WinPixEventRuntime REQUIRED) | ||
target_link_libraries(main PRIVATE microsoft::WinPixEventRuntime) |
Oops, something went wrong.