add tracy profiler dependency
This commit is contained in:
@ -3,16 +3,32 @@ project(MassSprings)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
|
||||
|
||||
find_package(raylib REQUIRED)
|
||||
find_package(OpenMP REQUIRED)
|
||||
|
||||
# TODO: Need to enable/disable this based on a variable for nix build
|
||||
if(USE_TRACY)
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(tracy
|
||||
GIT_REPOSITORY https://github.com/wolfpld/tracy.git
|
||||
GIT_TAG v0.11.1
|
||||
GIT_SHALLOW TRUE
|
||||
GIT_PROGRESS TRUE
|
||||
)
|
||||
FetchContent_MakeAvailable(tracy)
|
||||
option(TRACY_ENABLE "" ON)
|
||||
option(TRACY_ON_DEMAND "" ON)
|
||||
endif()
|
||||
|
||||
include_directories(include)
|
||||
|
||||
add_executable(masssprings
|
||||
src/main.cpp
|
||||
src/camera.cpp
|
||||
src/renderer.cpp
|
||||
src/octree.cpp
|
||||
src/physics.cpp
|
||||
src/puzzle.cpp
|
||||
src/state.cpp
|
||||
@ -20,4 +36,8 @@ add_executable(masssprings
|
||||
)
|
||||
|
||||
target_include_directories(masssprings PUBLIC ${RAYLIB_CPP_INCLUDE_DIR})
|
||||
if(USE_TRACY)
|
||||
target_link_libraries(masssprings PUBLIC raylib OpenMP::OpenMP_CXX TracyClient)
|
||||
else()
|
||||
target_link_libraries(masssprings PUBLIC raylib OpenMP::OpenMP_CXX)
|
||||
endif()
|
||||
|
||||
@ -125,7 +125,9 @@ rec {
|
||||
# clang-tools
|
||||
# compdb
|
||||
# pprof
|
||||
gprof2dot
|
||||
# gprof2dot
|
||||
perf
|
||||
hotspot
|
||||
kdePackages.kcachegrind
|
||||
gdbgui
|
||||
# renderdoc
|
||||
@ -141,6 +143,7 @@ rec {
|
||||
raylib
|
||||
# octree # this one doesn't store center of mass per node - which I need :(
|
||||
llvmPackages.openmp # not required for compilation but for clangd to find the headers
|
||||
tracy
|
||||
# raylib-cpp
|
||||
# tinyobjloader
|
||||
# gperftools
|
||||
@ -225,6 +228,7 @@ rec {
|
||||
echo "Running cmake"
|
||||
cmake -G "Unix Makefiles" \
|
||||
-DCMAKE_BUILD_TYPE="${type}" \
|
||||
-DUSE_TRACY=On \
|
||||
..
|
||||
|
||||
echo "Linking compile_commands.json"
|
||||
|
||||
Reference in New Issue
Block a user