mirror of
https://github.com/wolfpld/tracy
synced 2025-05-02 13:43:52 +00:00
Add documentation for CMake integration
This commit is contained in:
parent
0fe755fc85
commit
958386709f
@ -55,10 +55,3 @@ set_option(TRACY_NO_FRAME_IMAGE)
|
|||||||
set_option(TRACE_NO_SAMPLING)
|
set_option(TRACE_NO_SAMPLING)
|
||||||
set_option(TRACY_NO_VERIFY)
|
set_option(TRACY_NO_VERIFY)
|
||||||
set_option(TRACY_NO_VSYNC_CAPTURE)
|
set_option(TRACY_NO_VSYNC_CAPTURE)
|
||||||
|
|
||||||
if(NOT TRACY_PORT)
|
|
||||||
set(TRACY_PORT 8086)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
message(STATUS "TRACY_PORT: ${TRACY_PORT}")
|
|
||||||
target_compile_definitions(TracyClient PUBLIC TRACY_PORT=${TRACY_PORT})
|
|
||||||
|
@ -425,6 +425,27 @@ The application you want to profile should be compiled with all the usual optimi
|
|||||||
|
|
||||||
Finally, on Unix make sure that the application is linked with libraries \texttt{libpthread} and \texttt{libdl}. BSD systems will also need to be linked with \texttt{libexecinfo}.
|
Finally, on Unix make sure that the application is linked with libraries \texttt{libpthread} and \texttt{libdl}. BSD systems will also need to be linked with \texttt{libexecinfo}.
|
||||||
|
|
||||||
|
\begin{bclogo}[
|
||||||
|
noborder=true,
|
||||||
|
couleur=black!5,
|
||||||
|
logo=\bclampe
|
||||||
|
]{CMake integration}
|
||||||
|
You can integrate Tracy easily with CMake by adding the git submodule folder as a subdirectory.
|
||||||
|
|
||||||
|
\begin{lstlisting}
|
||||||
|
# set options before add_subdirectory
|
||||||
|
# available options: TRACY_ENABLE, TRACY_ON_DEMAND, TRACY_NO_BROADCAST, TRACY_NO_CODE_TRANSFER, ...
|
||||||
|
option(TRACY_ENABLE "" ON)
|
||||||
|
option(TRACY_ON_DEMAND "" ON)
|
||||||
|
add_subdirectory(3rdparty/tracy) # target: TracyClient or alias Tracy::TracyClient
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
Link \texttt{Tracy::TracyClient} to any target where you use Tracy for profiling:
|
||||||
|
|
||||||
|
\begin{lstlisting}
|
||||||
|
target_link_libraries(<TARGET> PUBLIC Tracy::TracyClient)
|
||||||
|
\end{lstlisting}
|
||||||
|
\end{bclogo}
|
||||||
|
|
||||||
\begin{bclogo}[
|
\begin{bclogo}[
|
||||||
noborder=true,
|
noborder=true,
|
||||||
@ -448,7 +469,7 @@ FetchContent_MakeAvailable(tracy)
|
|||||||
Then add this to any target where you use tracy for profiling:
|
Then add this to any target where you use tracy for profiling:
|
||||||
|
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
target_link_libraries(${_target} PUBLIC TracyClient)
|
target_link_libraries(<TARGET> PUBLIC TracyClient)
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
\end{bclogo}
|
\end{bclogo}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user