Skip to content

Commit

Permalink
[perfetto] initial port of 43.1 (microsoft#37959)
Browse files Browse the repository at this point in the history
  • Loading branch information
rtzoeller authored Apr 15, 2024
1 parent 8d1bb02 commit b4a3d89
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 0 deletions.
40 changes: 40 additions & 0 deletions ports/perfetto/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Unofficial perfetto CMakeLists.txt from https://github.com/google/perfetto/blob/v43.1/meson.build
cmake_minimum_required(VERSION 3.23)
project(perfetto LANGUAGES CXX)

add_library(perfetto)
target_compile_features(perfetto PRIVATE cxx_std_17)
target_sources(perfetto
PRIVATE "sdk/perfetto.cc"
PUBLIC FILE_SET HEADERS BASE_DIRS "sdk" FILES "sdk/perfetto.h"
)

set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
target_link_libraries(perfetto PRIVATE Threads::Threads)

if(ANDROID)
target_link_libraries(perfetto PRIVATE log)
endif(ANDROID)

if(WIN32)
target_compile_options(perfetto PRIVATE "/bigobj")
target_compile_definitions(perfetto PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
target_link_libraries(perfetto PRIVATE ws2_32)
endif(WIN32)

if(MSVC)
target_compile_options(perfetto PRIVATE "/permissive-")
endif(MSVC)

install(TARGETS perfetto
EXPORT unofficial-perfetto-config
FILE_SET HEADERS DESTINATION "include"
)

install(EXPORT unofficial-perfetto-config
NAMESPACE unofficial::perfetto::
DESTINATION "share/unofficial-perfetto"
)

install(FILES "protos/perfetto/trace/perfetto_trace.proto" DESTINATION "share/unofficial-perfetto")
28 changes: 28 additions & 0 deletions ports/perfetto/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
if (VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO google/perfetto
REF "v${VERSION}"
SHA512 9ad6f314e6e56558f7062290afef840d81689776bf3a31708a61fef9ea8d80ac00892b5316856adc784b17e71c67a8429500602b301958ccba24fc4a3b6ac6f8
HEAD_REF main
)

file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT})

file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
)

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
19 changes: 19 additions & 0 deletions ports/perfetto/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "perfetto",
"version": "43.1",
"description": "System profiling, app tracing and trace analysis",
"homepage": "https://perfetto.dev",
"license": "Apache-2.0",
"supports": "!uwp & !x86",
"dependencies": [
"pthreads",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6728,6 +6728,10 @@
"baseline": "2.8.3",
"port-version": 3
},
"perfetto": {
"baseline": "43.1",
"port-version": 0
},
"pffft": {
"baseline": "2021-10-09",
"port-version": 1
Expand Down
9 changes: 9 additions & 0 deletions versions/p-/perfetto.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "db7cf7be562a134411d6aadaeef44df6e9758e6f",
"version": "43.1",
"port-version": 0
}
]
}

0 comments on commit b4a3d89

Please sign in to comment.