Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tracy integration, allow parent projects to include RmlUi profiling markers #518

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

mikke89
Copy link
Owner

@mikke89 mikke89 commented Sep 30, 2023

Tracy client can now be included in one of three ways, in prioritized order:

  1. Using target Tracy::TracyClient from parent project.
  2. As a config package.
  3. With Tracy source files located in 'Dependencies/Tracy'.

Adds three new CMake options:

  • RMLUI_TRACY_PROFILING: Enable profiling, replaces the old option ENABLE_TRACY_PROFILING.
  • RMLUI_TRACY_MEMORY_PROFILING: Overloads global operator new/delete for memory inspection.
  • RMLUI_TRACY_CONFIGURATION: Only relevant for multi-config generators. If enabled, adds Tracy as a separate configuration, otherwise adds Tracy to all configurations.

Solves #516.

@mikke89 mikke89 added the build Build system and compilation label Sep 30, 2023
@p2004a
Copy link

p2004a commented Sep 30, 2023

I've not looked over the code yet, but with those changes I was able to super easily just enabled it after switching 2 options

Screenshot from 2023-09-30 22-09-05

I will take a look at the code tomorrow :)

@hobyst
Copy link
Contributor

hobyst commented Oct 1, 2023

@p2004a Does it work when you compile RmlUi as a static library?

CMakeLists.txt Outdated Show resolved Hide resolved
@p2004a
Copy link

p2004a commented Oct 9, 2023

@p2004a Does it work when you compile RmlUi as a static library?

I've actually tried only as static library, not shared. If RmlUi is shared, also tracy would need to be linked as shared, their cmake has config for it, but it's using static as default, whereas with RmlUi is using shared as default so AFAIU it can cause issue if the project using both libraries is not explicitly itself setting the BUILD_SHARED_LIBS option.

…iling markers, solves #516

Tracy client can now be included in one of three ways, in prioritized order:
1. Using target Tracy::TracyClient from parent project.
2. As a config package.
3. With Tracy source files located in 'Dependencies/Tracy'.

Adds three new CMake options:
- `RMLUI_TRACY_PROFILING`: Enable profiling, replaces the old option `ENABLE_TRACY_PROFILING`.
- `RMLUI_TRACY_MEMORY_PROFILING`: Overloads global operator new/delete for memory inspection.
- `RMLUI_TRACY_CONFIGURATION`: Only relevant for multi-config generators. If enabled, adds Tracy as a separate configuration, otherwise adds Tracy to all configurations.
@mikke89 mikke89 linked an issue Oct 11, 2023 that may be closed by this pull request
@mikke89 mikke89 merged commit f43ee36 into master Oct 11, 2023
26 of 28 checks passed
@mikke89 mikke89 deleted the tracy branch October 11, 2023 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build system and compilation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enabling Tracy profiling when Tracy is already used
3 participants