Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 30 additions & 10 deletions ports/tracy/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
vcpkg_download_distfile(PATCH_MISSING_CHRONO_INCLUDE
URLS https://github.com/wolfpld/tracy/commit/50ff279aaddfd91dc3cdcfd5b7aec3978e63da25.diff?full_index=1
SHA512 f9594297ea68612b68bd631497cd312ea01b34280a0f098de0d2b99810149345251a8985a6430337d0b55d2f181ceac10d563b64cfe48f78959f79ec7a6ea3b5
FILENAME wolfpld-tracy-PR982.diff
)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO wolfpld/tracy
REF "v${VERSION}"
SHA512 d3d99284e3c3172236c3f02b3bc52df111ef650fb8609e54fb3302ece28e55a06cd16713ed532f1e1aad66678ff09639dfc7e01a1e96880fb923b267a1b1b79b
SHA512 18c0c589a1d97d0760958c8ab00ba2135bc602fd359d48445b5d8ed76e5b08742d818bb8f835b599149030f455e553a92db86fb7bae049b47820e4401cf9f935
HEAD_REF master
PATCHES
build-tools.patch
"${PATCH_MISSING_CHRONO_INCLUDE}"
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
on-demand TRACY_ON_DEMAND
fibers TRACY_FIBERS
fibers TRACY_FIBERS
verbose TRACY_VERBOSE
INVERTED_FEATURES
crash-handler TRACY_NO_CRASH_HANDLER
Expand Down Expand Up @@ -47,9 +40,36 @@ vcpkg_cmake_configure(
DOWNLOAD_CAPSTONE
LEGACY
)

vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(PACKAGE_NAME Tracy)

if(EXISTS "${CURRENT_PACKAGES_DIR}/include/tracy/tracy")
message(STATUS "Flattening include/tracy/tracy...")

file(GLOB INNER_FILES "${CURRENT_PACKAGES_DIR}/include/tracy/tracy/*")
file(COPY ${INNER_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/include/tracy")

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/tracy/tracy")
endif()

message(STATUS "Patching headers to fix relative includes...")
file(GLOB_RECURSE TRACY_HEADERS "${CURRENT_PACKAGES_DIR}/include/tracy/*.hpp" "${CURRENT_PACKAGES_DIR}/include/tracy/*.h")

foreach(HEADER ${TRACY_HEADERS})
file(READ "${HEADER}" _contents)

string(REPLACE "../common" "common" _contents "${_contents}")
string(REPLACE "../client" "client" _contents "${_contents}")
string(REPLACE "../libbacktrace" "libbacktrace" _contents "${_contents}")

file(WRITE "${HEADER}" "${_contents}")
endforeach()
Comment on lines +47 to +67
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this change upstreams intended usage?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually restores it. The former versions (including the current one on vcpkg) only has "tracy". So files were included using:

#include <tracy/Tracy.hpp>

Now, with the addition of common and client in more recent versions, the includes became:

#include <tracy/tracy/Tracy.hpp>

This little patch is the one allowing us to keep on using the former includes without having to add a redundant tracy/tracy. Someone I know using this package used my patch and was also able to update seamlessly. I am running it also on my static windows x64.

Please note that I'm new into maintaining vcpkg packages so if I did something I shouldn't, feel free to remove this PR, or point me in the right direction

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would assume that include/tracy is meant to be part of include search path, and that this is carried by the INTERFACE_LINK_LIBRARIES property of the the CMake config. And then #include <tracy/Tracy.hpp> would break instead of being fixed when files are moved out of include/tracy/tracy.
Users of uninformed build systems (msbuild at al.) must adjust the include search path manually.


vcpkg_cmake_config_fixup(
PACKAGE_NAME Tracy
CONFIG_PATH lib/cmake/Tracy
)

function(tracy_copy_tool tool_name tool_dir)
vcpkg_copy_tools(
Expand Down
3 changes: 1 addition & 2 deletions ports/tracy/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "tracy",
"version": "0.11.1",
"port-version": 2,
"version": "0.13.1",
"description": "A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications.",
"homepage": "https://github.com/wolfpld/tracy",
"license": "BSD-3-Clause",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -9901,8 +9901,8 @@
"port-version": 6
},
"tracy": {
"baseline": "0.11.1",
"port-version": 2
"baseline": "0.13.1",
"port-version": 0
},
"transwarp": {
"baseline": "2.2.3",
Expand Down
5 changes: 5 additions & 0 deletions versions/t-/tracy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "502251f858908fbbdfe3f924693acda8cdb68841",
"version": "0.13.1",
"port-version": 0
},
{
"git-tree": "ff802e1b85c20b5f276c4b82aaa60fc933444ab2",
"version": "0.11.1",
Expand Down
Loading