mirror of
https://github.com/wolfpld/tracy.git
synced 2026-11-19 22:25:59 +00:00
Merge pull request #1519 from Lectem/monitor-client-options
Build tracy-monitor's client through the root project.
This commit is contained in:
+11
-13
@@ -22,7 +22,6 @@ if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|aarch64|arm64)$")
|
||||
endif()
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
option(TRACY_ON_DEMAND "On-demand profiling: record samples only while a Tracy server is connected" OFF)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/config.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/vendor.cmake)
|
||||
@@ -34,19 +33,18 @@ set(PROGRAM_FILES
|
||||
src/monitor.cpp
|
||||
)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${PROGRAM_FILES} ${TRACY_PUBLIC_DIR}/TracyClient.cpp)
|
||||
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC
|
||||
$<BUILD_INTERFACE:${TRACY_PUBLIC_DIR}>
|
||||
$<INSTALL_INTERFACE:include/tracy>)
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||
TRACY_ENABLE
|
||||
TRACY_MANUAL_LIFETIME
|
||||
TRACY_NO_FRAME_IMAGE
|
||||
)
|
||||
if(TRACY_ON_DEMAND)
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE TRACY_ON_DEMAND)
|
||||
endif()
|
||||
# Build the Tracy client through the root project, so that its TRACY_* options
|
||||
# (TRACY_ON_DEMAND, TRACY_ONLY_LOCALHOST, ...) can be set by the user.
|
||||
# The options below are required by monitor and are forced; they cannot be overridden.
|
||||
set(TRACY_ENABLE ON CACHE BOOL "Required by tracy-monitor" FORCE)
|
||||
set(TRACY_MANUAL_LIFETIME ON CACHE BOOL "Required by tracy-monitor" FORCE)
|
||||
set(TRACY_NO_FRAME_IMAGE ON CACHE BOOL "Required by tracy-monitor" FORCE)
|
||||
set(TRACY_STATIC ON CACHE BOOL "Required by tracy-monitor" FORCE)
|
||||
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/.. tracy-client EXCLUDE_FROM_ALL)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${PROGRAM_FILES})
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||
Tracy::TracyClient
|
||||
TracyServer
|
||||
TracyUtil
|
||||
Threads::Threads
|
||||
|
||||
Reference in New Issue
Block a user