feat add microprofile
Some checks failed
cpp-template / build (Debug, aarch64-linux-gnu) (push) Failing after 18s
cpp-template / build (Debug, arm-linux-gnueabihf) (push) Failing after 17s
cpp-template / build (Debug, mipsel-linux-gnu) (push) Failing after 18s
cpp-template / build (Release, aarch64-linux-gnu) (push) Failing after 13s
cpp-template / build (Release, host.gcc) (push) Has been cancelled
cpp-template / build (Release, mipsel-linux-gnu) (push) Has been cancelled
cpp-template / build (Debug, host.gcc) (push) Has been cancelled
cpp-template / build (Release, arm-linux-gnueabihf) (push) Has been cancelled
Some checks failed
cpp-template / build (Debug, aarch64-linux-gnu) (push) Failing after 18s
cpp-template / build (Debug, arm-linux-gnueabihf) (push) Failing after 17s
cpp-template / build (Debug, mipsel-linux-gnu) (push) Failing after 18s
cpp-template / build (Release, aarch64-linux-gnu) (push) Failing after 13s
cpp-template / build (Release, host.gcc) (push) Has been cancelled
cpp-template / build (Release, mipsel-linux-gnu) (push) Has been cancelled
cpp-template / build (Debug, host.gcc) (push) Has been cancelled
cpp-template / build (Release, arm-linux-gnueabihf) (push) Has been cancelled
This commit is contained in:
@@ -11,10 +11,10 @@ if(CMAKE_CXX_COMPILER_ID
|
|||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# option(
|
option(
|
||||||
# WITH_MICROPROFILE
|
WITH_MICROPROFILE
|
||||||
# "with MicroProfile"
|
"with MicroProfile"
|
||||||
# ON)
|
ON)
|
||||||
option(
|
option(
|
||||||
WITH_EXAMPLES
|
WITH_EXAMPLES
|
||||||
"with examples"
|
"with examples"
|
||||||
@@ -55,7 +55,9 @@ CPMAddPackage(
|
|||||||
NAME tracy
|
NAME tracy
|
||||||
URI https://github.com/wolfpld/tracy
|
URI https://github.com/wolfpld/tracy
|
||||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/tracy
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/tracy
|
||||||
OPTIONS "TRACY_ENABLE ON" "TRACY_ON_DEMAND ON"
|
OPTIONS "TRACY_ENABLE ON"
|
||||||
|
"TRACY_ON_DEMAND ON"
|
||||||
|
"TRACY_TIMER_FALLBACK ON"
|
||||||
FORCE)
|
FORCE)
|
||||||
|
|
||||||
CPMAddPackage(
|
CPMAddPackage(
|
||||||
@@ -74,7 +76,9 @@ CPMAddPackage(
|
|||||||
FORCE)
|
FORCE)
|
||||||
|
|
||||||
if(WITH_EXAMPLES)
|
if(WITH_EXAMPLES)
|
||||||
# cc_executable(microprofile_demo SRCS examples/microprofile_demo.cc)
|
if(WITH_MICROPROFILE)
|
||||||
|
cc_executable(microprofile_demo SRCS examples/microprofile_demo.cc)
|
||||||
|
endif()
|
||||||
cc_executable(tracy_demo SRCS examples/tracy_demo.cc)
|
cc_executable(tracy_demo SRCS examples/tracy_demo.cc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
|
#include <common/TracyMutex.hpp>
|
||||||
|
#include <mutex>
|
||||||
#include <tracy/Tracy.hpp>
|
#include <tracy/Tracy.hpp>
|
||||||
void Test()
|
void Test()
|
||||||
{
|
{
|
||||||
|
TracyLockable(std::mutex, lock);
|
||||||
|
std::lock_guard<LockableBase(std::mutex)> _(lock);
|
||||||
|
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
301
third_party/tracy/CMakeLists.txt
vendored
301
third_party/tracy/CMakeLists.txt
vendored
@@ -3,9 +3,15 @@ cmake_minimum_required(VERSION 3.10)
|
|||||||
# Run version helper script
|
# Run version helper script
|
||||||
include(cmake/version.cmake)
|
include(cmake/version.cmake)
|
||||||
|
|
||||||
project(Tracy LANGUAGES CXX VERSION ${TRACY_VERSION_STRING})
|
project(
|
||||||
|
Tracy
|
||||||
|
LANGUAGES CXX
|
||||||
|
VERSION ${TRACY_VERSION_STRING})
|
||||||
|
|
||||||
file(GENERATE OUTPUT .gitignore CONTENT "*")
|
file(
|
||||||
|
GENERATE
|
||||||
|
OUTPUT .gitignore
|
||||||
|
CONTENT "*")
|
||||||
|
|
||||||
if(${BUILD_SHARED_LIBS})
|
if(${BUILD_SHARED_LIBS})
|
||||||
set(DEFAULT_STATIC OFF)
|
set(DEFAULT_STATIC OFF)
|
||||||
@@ -13,9 +19,18 @@ else()
|
|||||||
set(DEFAULT_STATIC ON)
|
set(DEFAULT_STATIC ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(TRACY_STATIC "Whether to build Tracy as a static library" ${DEFAULT_STATIC})
|
option(
|
||||||
option(TRACY_Fortran "Build Fortran bindings" OFF)
|
TRACY_STATIC
|
||||||
option(TRACY_LTO "Enable Link-Time optimization" OFF)
|
"Whether to build Tracy as a static library"
|
||||||
|
${DEFAULT_STATIC})
|
||||||
|
option(
|
||||||
|
TRACY_Fortran
|
||||||
|
"Build Fortran bindings"
|
||||||
|
OFF)
|
||||||
|
option(
|
||||||
|
TRACY_LTO
|
||||||
|
"Enable Link-Time optimization"
|
||||||
|
OFF)
|
||||||
|
|
||||||
if(TRACY_Fortran)
|
if(TRACY_Fortran)
|
||||||
enable_language(Fortran)
|
enable_language(Fortran)
|
||||||
@@ -33,7 +48,10 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
find_package(rocprofiler-sdk PATHS "/opt/rocm/lib/cmake")
|
find_package(
|
||||||
|
rocprofiler-sdk
|
||||||
|
PATHS
|
||||||
|
"/opt/rocm/lib/cmake")
|
||||||
|
|
||||||
set(TRACY_PUBLIC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/public)
|
set(TRACY_PUBLIC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/public)
|
||||||
|
|
||||||
@@ -45,68 +63,87 @@ else()
|
|||||||
set(TRACY_VISIBILITY "SHARED")
|
set(TRACY_VISIBILITY "SHARED")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(TracyClient ${TRACY_VISIBILITY} "${TRACY_PUBLIC_DIR}/TracyClient.cpp")
|
add_library(TracyClient ${TRACY_VISIBILITY}
|
||||||
|
"${TRACY_PUBLIC_DIR}/TracyClient.cpp")
|
||||||
target_compile_features(TracyClient PUBLIC cxx_std_11)
|
target_compile_features(TracyClient PUBLIC cxx_std_11)
|
||||||
set_target_properties(TracyClient PROPERTIES INTERPROCEDURAL_OPTIMIZATION ${LTO_SUPPORTED})
|
set_target_properties(TracyClient PROPERTIES INTERPROCEDURAL_OPTIMIZATION
|
||||||
target_include_directories(TracyClient SYSTEM PUBLIC
|
${LTO_SUPPORTED})
|
||||||
$<BUILD_INTERFACE:${TRACY_PUBLIC_DIR}>
|
target_include_directories(
|
||||||
|
TracyClient SYSTEM PUBLIC $<BUILD_INTERFACE:${TRACY_PUBLIC_DIR}>
|
||||||
$<INSTALL_INTERFACE:include/tracy>)
|
$<INSTALL_INTERFACE:include/tracy>)
|
||||||
target_link_libraries(
|
target_link_libraries(TracyClient PUBLIC Threads::Threads ${CMAKE_DL_LIBS})
|
||||||
TracyClient
|
|
||||||
PUBLIC
|
|
||||||
Threads::Threads
|
|
||||||
${CMAKE_DL_LIBS}
|
|
||||||
)
|
|
||||||
if(rocprofiler-sdk_FOUND)
|
if(rocprofiler-sdk_FOUND)
|
||||||
target_compile_definitions(TracyClient PUBLIC TRACY_ROCPROF)
|
target_compile_definitions(TracyClient PUBLIC TRACY_ROCPROF)
|
||||||
target_link_libraries(TracyClient PUBLIC rocprofiler-sdk::rocprofiler-sdk)
|
target_link_libraries(TracyClient PUBLIC rocprofiler-sdk::rocprofiler-sdk)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(TRACY_Fortran)
|
if(TRACY_Fortran)
|
||||||
add_library(TracyClientF90 ${TRACY_VISIBILITY} "${TRACY_PUBLIC_DIR}/TracyClient.F90")
|
add_library(TracyClientF90 ${TRACY_VISIBILITY}
|
||||||
target_include_directories(TracyClientF90 PUBLIC
|
"${TRACY_PUBLIC_DIR}/TracyClient.F90")
|
||||||
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
|
target_include_directories(
|
||||||
|
TracyClientF90 PUBLIC $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
|
||||||
$<INSTALL_INTERFACE:include/tracy>)
|
$<INSTALL_INTERFACE:include/tracy>)
|
||||||
target_link_libraries(
|
target_link_libraries(TracyClientF90 PUBLIC TracyClient)
|
||||||
TracyClientF90
|
set_target_properties(
|
||||||
PUBLIC
|
TracyClientF90 PROPERTIES Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||||
TracyClient
|
|
||||||
)
|
|
||||||
set_target_properties(TracyClientF90 PROPERTIES Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}
|
|
||||||
INTERPROCEDURAL_OPTIMIZATION ${LTO_SUPPORTED})
|
INTERPROCEDURAL_OPTIMIZATION ${LTO_SUPPORTED})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Public dependency on some libraries required when using Mingw
|
# Public dependency on some libraries required when using Mingw
|
||||||
if(WIN32 AND ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU|Clang")
|
if(WIN32
|
||||||
|
AND ${CMAKE_CXX_COMPILER_ID}
|
||||||
|
MATCHES
|
||||||
|
"GNU|Clang")
|
||||||
target_link_libraries(TracyClient PUBLIC ws2_32 dbghelp)
|
target_link_libraries(TracyClient PUBLIC ws2_32 dbghelp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
|
if(CMAKE_SYSTEM_NAME
|
||||||
|
MATCHES
|
||||||
|
"FreeBSD")
|
||||||
find_library(EXECINFO_LIBRARY NAMES execinfo REQUIRED)
|
find_library(EXECINFO_LIBRARY NAMES execinfo REQUIRED)
|
||||||
target_link_libraries(TracyClient PUBLIC ${EXECINFO_LIBRARY})
|
target_link_libraries(TracyClient PUBLIC ${EXECINFO_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(TRACY_LIBUNWIND_BACKTRACE)
|
if(TRACY_LIBUNWIND_BACKTRACE)
|
||||||
include(FindPkgConfig)
|
include(FindPkgConfig)
|
||||||
pkg_check_modules(unwind REQUIRED libunwind)
|
pkg_check_modules(
|
||||||
|
unwind
|
||||||
|
REQUIRED
|
||||||
|
libunwind)
|
||||||
target_include_directories(TracyClient INTERFACE ${unwind_INCLUDE_DIRS})
|
target_include_directories(TracyClient INTERFACE ${unwind_INCLUDE_DIRS})
|
||||||
target_link_libraries(TracyClient INTERFACE ${unwind_LINK_LIBRARIES})
|
target_link_libraries(TracyClient INTERFACE ${unwind_LINK_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(TRACY_DEBUGINFOD)
|
if(TRACY_DEBUGINFOD)
|
||||||
include(FindPkgConfig)
|
include(FindPkgConfig)
|
||||||
pkg_check_modules(debuginfod REQUIRED libdebuginfod)
|
pkg_check_modules(
|
||||||
|
debuginfod
|
||||||
|
REQUIRED
|
||||||
|
libdebuginfod)
|
||||||
target_include_directories(TracyClient INTERFACE ${debuginfod_INCLUDE_DIRS})
|
target_include_directories(TracyClient INTERFACE ${debuginfod_INCLUDE_DIRS})
|
||||||
target_link_libraries(TracyClient INTERFACE ${debuginfod_LINK_LIBRARIES})
|
target_link_libraries(TracyClient INTERFACE ${debuginfod_LINK_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(Tracy::TracyClient ALIAS TracyClient)
|
add_library(
|
||||||
|
Tracy::TracyClient
|
||||||
|
ALIAS
|
||||||
|
TracyClient)
|
||||||
if(TRACY_Fortran)
|
if(TRACY_Fortran)
|
||||||
add_library(Tracy::TracyClient_Fortran ALIAS TracyClientF90)
|
add_library(
|
||||||
|
Tracy::TracyClient_Fortran
|
||||||
|
ALIAS
|
||||||
|
TracyClientF90)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
macro(set_option option help value)
|
macro(
|
||||||
option(${option} ${help} ${value})
|
set_option
|
||||||
|
option
|
||||||
|
help
|
||||||
|
value)
|
||||||
|
option(
|
||||||
|
${option}
|
||||||
|
${help}
|
||||||
|
${value})
|
||||||
if(${option})
|
if(${option})
|
||||||
message(STATUS "${option}: ON")
|
message(STATUS "${option}: ON")
|
||||||
target_compile_definitions(TracyClient PUBLIC ${option})
|
target_compile_definitions(TracyClient PUBLIC ${option})
|
||||||
@@ -115,46 +152,136 @@ macro(set_option option help value)
|
|||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
set_option(TRACY_ENABLE "Enable profiling" ON)
|
set_option(
|
||||||
set_option(TRACY_ON_DEMAND "On-demand profiling" OFF)
|
TRACY_ENABLE
|
||||||
set_option(TRACY_CALLSTACK "Enforce callstack collection for tracy regions" OFF)
|
"Enable profiling"
|
||||||
set_option(TRACY_NO_CALLSTACK "Disable all callstack related functionality" OFF)
|
ON)
|
||||||
set_option(TRACY_NO_CALLSTACK_INLINES "Disables the inline functions in callstacks" OFF)
|
set_option(
|
||||||
set_option(TRACY_ONLY_LOCALHOST "Only listen on the localhost interface" OFF)
|
TRACY_ON_DEMAND
|
||||||
set_option(TRACY_NO_BROADCAST "Disable client discovery by broadcast to local network" OFF)
|
"On-demand profiling"
|
||||||
set_option(TRACY_ONLY_IPV4 "Tracy will only accept connections on IPv4 addresses (disable IPv6)" OFF)
|
OFF)
|
||||||
set_option(TRACY_NO_CODE_TRANSFER "Disable collection of source code" OFF)
|
set_option(
|
||||||
set_option(TRACY_NO_CONTEXT_SWITCH "Disable capture of context switches" OFF)
|
TRACY_CALLSTACK
|
||||||
set_option(TRACY_NO_EXIT "Client executable does not exit until all profile data is sent to server" OFF)
|
"Enforce callstack collection for tracy regions"
|
||||||
set_option(TRACY_NO_SAMPLING "Disable call stack sampling" OFF)
|
OFF)
|
||||||
set_option(TRACY_NO_VERIFY "Disable zone validation for C API" OFF)
|
set_option(
|
||||||
set_option(TRACY_NO_VSYNC_CAPTURE "Disable capture of hardware Vsync events" OFF)
|
TRACY_NO_CALLSTACK
|
||||||
set_option(TRACY_NO_FRAME_IMAGE "Disable the frame image support and its thread" OFF)
|
"Disable all callstack related functionality"
|
||||||
set_option(TRACY_NO_SYSTEM_TRACING "Disable systrace sampling" OFF)
|
OFF)
|
||||||
set_option(TRACY_PATCHABLE_NOPSLEDS "Enable nopsleds for efficient patching by system-level tools (e.g. rr)" OFF)
|
set_option(
|
||||||
set_option(TRACY_DELAYED_INIT "Enable delayed initialization of the library (init on first call)" OFF)
|
TRACY_NO_CALLSTACK_INLINES
|
||||||
set_option(TRACY_MANUAL_LIFETIME "Enable the manual lifetime management of the profile" OFF)
|
"Disables the inline functions in callstacks"
|
||||||
set_option(TRACY_FIBERS "Enable fibers support" OFF)
|
OFF)
|
||||||
set_option(TRACY_NO_CRASH_HANDLER "Disable crash handling" OFF)
|
set_option(
|
||||||
set_option(TRACY_TIMER_FALLBACK "Use lower resolution timers" OFF)
|
TRACY_ONLY_LOCALHOST
|
||||||
set_option(TRACY_LIBUNWIND_BACKTRACE "Use libunwind backtracing where supported" OFF)
|
"Only listen on the localhost interface"
|
||||||
set_option(TRACY_SYMBOL_OFFLINE_RESOLVE "Instead of full runtime symbol resolution, only resolve the image path and offset to enable offline symbol resolution" OFF)
|
OFF)
|
||||||
set_option(TRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT "Enable libbacktrace to support dynamically loaded elfs in symbol resolution resolution after the first symbol resolve operation" OFF)
|
set_option(
|
||||||
set_option(TRACY_DEBUGINFOD "Enable debuginfod support" OFF)
|
TRACY_NO_BROADCAST
|
||||||
|
"Disable client discovery by broadcast to local network"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_ONLY_IPV4
|
||||||
|
"Tracy will only accept connections on IPv4 addresses (disable IPv6)"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_NO_CODE_TRANSFER
|
||||||
|
"Disable collection of source code"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_NO_CONTEXT_SWITCH
|
||||||
|
"Disable capture of context switches"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_NO_EXIT
|
||||||
|
"Client executable does not exit until all profile data is sent to server"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_NO_SAMPLING
|
||||||
|
"Disable call stack sampling"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_NO_VERIFY
|
||||||
|
"Disable zone validation for C API"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_NO_VSYNC_CAPTURE
|
||||||
|
"Disable capture of hardware Vsync events"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_NO_FRAME_IMAGE
|
||||||
|
"Disable the frame image support and its thread"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_NO_SYSTEM_TRACING
|
||||||
|
"Disable systrace sampling"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_PATCHABLE_NOPSLEDS
|
||||||
|
"Enable nopsleds for efficient patching by system-level tools (e.g. rr)"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_DELAYED_INIT
|
||||||
|
"Enable delayed initialization of the library (init on first call)"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_MANUAL_LIFETIME
|
||||||
|
"Enable the manual lifetime management of the profile"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_FIBERS
|
||||||
|
"Enable fibers support"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_NO_CRASH_HANDLER
|
||||||
|
"Disable crash handling"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_TIMER_FALLBACK
|
||||||
|
"Use lower resolution timers"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_LIBUNWIND_BACKTRACE
|
||||||
|
"Use libunwind backtracing where supported"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_SYMBOL_OFFLINE_RESOLVE
|
||||||
|
"Instead of full runtime symbol resolution, only resolve the image path and offset to enable offline symbol resolution"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT
|
||||||
|
"Enable libbacktrace to support dynamically loaded elfs in symbol resolution resolution after the first symbol resolve operation"
|
||||||
|
OFF)
|
||||||
|
set_option(
|
||||||
|
TRACY_DEBUGINFOD
|
||||||
|
"Enable debuginfod support"
|
||||||
|
OFF)
|
||||||
|
|
||||||
# advanced
|
# advanced
|
||||||
set_option(TRACY_VERBOSE "[advanced] Verbose output from the profiler" OFF)
|
set_option(
|
||||||
|
TRACY_VERBOSE
|
||||||
|
"[advanced] Verbose output from the profiler"
|
||||||
|
OFF)
|
||||||
mark_as_advanced(TRACY_VERBOSE)
|
mark_as_advanced(TRACY_VERBOSE)
|
||||||
set_option(TRACY_DEMANGLE "[advanced] Don't use default demangling function - You'll need to provide your own" OFF)
|
set_option(
|
||||||
|
TRACY_DEMANGLE
|
||||||
|
"[advanced] Don't use default demangling function - You'll need to provide your own"
|
||||||
|
OFF)
|
||||||
mark_as_advanced(TRACY_DEMANGLE)
|
mark_as_advanced(TRACY_DEMANGLE)
|
||||||
if(rocprofiler-sdk_FOUND)
|
if(rocprofiler-sdk_FOUND)
|
||||||
set_option(TRACY_ROCPROF_CALIBRATION "[advanced] Use continuous calibration of the Rocprof GPU time." OFF)
|
set_option(
|
||||||
|
TRACY_ROCPROF_CALIBRATION
|
||||||
|
"[advanced] Use continuous calibration of the Rocprof GPU time."
|
||||||
|
OFF)
|
||||||
mark_as_advanced(TRACY_ROCPROF_CALIBRATION)
|
mark_as_advanced(TRACY_ROCPROF_CALIBRATION)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# handle incompatible combinations
|
# handle incompatible combinations
|
||||||
if(TRACY_MANUAL_LIFETIME AND NOT TRACY_DELAYED_INIT)
|
if(TRACY_MANUAL_LIFETIME AND NOT TRACY_DELAYED_INIT)
|
||||||
message(FATAL_ERROR "TRACY_MANUAL_LIFETIME can not be activated with disabled TRACY_DELAYED_INIT")
|
message(
|
||||||
|
FATAL_ERROR
|
||||||
|
"TRACY_MANUAL_LIFETIME can not be activated with disabled TRACY_DELAYED_INIT"
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT TRACY_STATIC)
|
if(NOT TRACY_STATIC)
|
||||||
@@ -221,26 +348,39 @@ set(common_includes
|
|||||||
${TRACY_PUBLIC_DIR}/common/TracyWinFamily.hpp
|
${TRACY_PUBLIC_DIR}/common/TracyWinFamily.hpp
|
||||||
${TRACY_PUBLIC_DIR}/common/TracyYield.hpp)
|
${TRACY_PUBLIC_DIR}/common/TracyYield.hpp)
|
||||||
|
|
||||||
install(TARGETS TracyClient
|
install(
|
||||||
|
TARGETS TracyClient
|
||||||
EXPORT TracyConfig
|
EXPORT TracyConfig
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
RUNTIME
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
DESTINATION ${CMAKE_INSTALL_BINDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
LIBRARY
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
||||||
|
ARCHIVE
|
||||||
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
||||||
COMPONENT lib)
|
COMPONENT lib)
|
||||||
if(TRACY_Fortran)
|
if(TRACY_Fortran)
|
||||||
install(TARGETS TracyClientF90
|
install(
|
||||||
|
TARGETS TracyClientF90
|
||||||
EXPORT TracyConfig
|
EXPORT TracyConfig
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
RUNTIME
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
DESTINATION
|
||||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
${CMAKE_INSTALL_BINDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
||||||
|
LIBRARY
|
||||||
|
DESTINATION
|
||||||
|
${CMAKE_INSTALL_LIBDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
||||||
|
ARCHIVE
|
||||||
|
DESTINATION
|
||||||
|
${CMAKE_INSTALL_LIBDIR}/$<IF:$<CONFIG:Release>,,$<CONFIG>>
|
||||||
COMPONENT lib)
|
COMPONENT lib)
|
||||||
endif()
|
endif()
|
||||||
# Export targets to build tree root
|
# Export targets to build tree root
|
||||||
export(TARGETS TracyClient
|
export(
|
||||||
|
TARGETS TracyClient
|
||||||
NAMESPACE Tracy::
|
NAMESPACE Tracy::
|
||||||
FILE ${CMAKE_BINARY_DIR}/TracyTargets.cmake)
|
FILE ${CMAKE_BINARY_DIR}/TracyTargets.cmake)
|
||||||
if(TRACY_Fortran)
|
if(TRACY_Fortran)
|
||||||
export(TARGETS TracyClientF90
|
export(
|
||||||
|
TARGETS TracyClientF90
|
||||||
NAMESPACE Tracy::
|
NAMESPACE Tracy::
|
||||||
APPEND
|
APPEND
|
||||||
FILE ${CMAKE_BINARY_DIR}/TracyTargets.cmake)
|
FILE ${CMAKE_BINARY_DIR}/TracyTargets.cmake)
|
||||||
@@ -252,7 +392,9 @@ install(FILES ${client_includes}
|
|||||||
install(FILES ${common_includes}
|
install(FILES ${common_includes}
|
||||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy/common)
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy/common)
|
||||||
if(TRACY_Fortran)
|
if(TRACY_Fortran)
|
||||||
if(${CMAKE_Fortran_COMPILER_ID} MATCHES "Cray")
|
if(${CMAKE_Fortran_COMPILER_ID}
|
||||||
|
MATCHES
|
||||||
|
"Cray")
|
||||||
install(FILES ${PROJECT_BINARY_DIR}/TRACY.mod
|
install(FILES ${PROJECT_BINARY_DIR}/TRACY.mod
|
||||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy)
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy)
|
||||||
else()
|
else()
|
||||||
@@ -260,18 +402,23 @@ if(TRACY_Fortran)
|
|||||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy)
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
install(EXPORT TracyConfig
|
install(
|
||||||
|
EXPORT TracyConfig
|
||||||
NAMESPACE Tracy::
|
NAMESPACE Tracy::
|
||||||
FILE TracyTargets.cmake
|
FILE TracyTargets.cmake
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
|
configure_package_config_file(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/TracyConfig.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/TracyConfig.cmake"
|
||||||
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/TracyConfig.cmake
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/TracyConfig.cmake
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
|
||||||
|
|
||||||
option(TRACY_CLIENT_PYTHON "Whether to build Tracy python client library" OFF)
|
option(
|
||||||
|
TRACY_CLIENT_PYTHON
|
||||||
|
"Whether to build Tracy python client library"
|
||||||
|
OFF)
|
||||||
|
|
||||||
if(TRACY_CLIENT_PYTHON)
|
if(TRACY_CLIENT_PYTHON)
|
||||||
if(TRACY_STATIC)
|
if(TRACY_STATIC)
|
||||||
|
|||||||
Reference in New Issue
Block a user