diff --git a/profiler/CMakeLists.txt b/profiler/CMakeLists.txt index 529c35f7..1f4ac363 100644 --- a/profiler/CMakeLists.txt +++ b/profiler/CMakeLists.txt @@ -66,10 +66,6 @@ set(SERVER_FILES TracyFileselector.cpp TracyFilesystem.cpp TracyImGui.cpp - TracyLlm.cpp - TracyLlmApi.cpp - TracyLlmEmbeddings.cpp - TracyLlmTools.cpp TracyMicroArchitecture.cpp TracyMouse.cpp TracyProtoHistory.cpp @@ -118,6 +114,15 @@ set(SERVER_FILES TracyWeb.cpp ) +if(NOT EMSCRIPTEN) + list(APPEND SERVER_FILES + TracyLlm.cpp + TracyLlmApi.cpp + TracyLlmEmbeddings.cpp + TracyLlmTools.cpp + ) +endif() + list(TRANSFORM SERVER_FILES PREPEND "src/profiler/") set(PROFILER_FILES diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp index b223ddc2..e0366ee6 100644 --- a/profiler/src/main.cpp +++ b/profiler/src/main.cpp @@ -782,8 +782,10 @@ static void DrawContents() if( ImGui::Checkbox( "Enable achievements", &tracy::s_config.achievements ) ) tracy::SaveConfig(); ImGui::Spacing(); if( ImGui::Checkbox( "Save UI scale", &tracy::s_config.saveUserScale) ) tracy::SaveConfig(); +#ifndef __EMSCRIPTEN__ ImGui::Spacing(); if( ImGui::Checkbox( "Enable LLM", &tracy::s_config.llm ) ) tracy::SaveConfig(); +#endif ImGui::PopStyleVar(); ImGui::TreePop(); diff --git a/profiler/src/profiler/TracyView.cpp b/profiler/src/profiler/TracyView.cpp index 66b60ffe..6b5f9e48 100644 --- a/profiler/src/profiler/TracyView.cpp +++ b/profiler/src/profiler/TracyView.cpp @@ -953,11 +953,13 @@ bool View::DrawImpl() ImGui::EndPopup(); } } +#ifndef __EMSCRIPTEN__ if( s_config.llm ) { ImGui::SameLine(); ToggleButton( ICON_FA_ROBOT, m_llm.m_show ); } +#endif if( m_worker.AreFramesUsed() ) { ImGui::SameLine(); @@ -1152,7 +1154,9 @@ bool View::DrawImpl() if( m_sampleParents.symAddr != 0 ) DrawSampleParents(); if( m_showRanges ) DrawRanges(); if( m_showWaitStacks ) DrawWaitStacks(); +#ifndef __EMSCRIPTEN__ if( m_llm.m_show ) m_llm.Draw(); +#endif if( m_setRangePopup.active ) { diff --git a/profiler/src/profiler/TracyView.hpp b/profiler/src/profiler/TracyView.hpp index fa5ef4e7..b731eab8 100644 --- a/profiler/src/profiler/TracyView.hpp +++ b/profiler/src/profiler/TracyView.hpp @@ -17,7 +17,6 @@ #include "TracyBuzzAnim.hpp" #include "TracyConfig.hpp" #include "TracyDecayValue.hpp" -#include "TracyLlm.hpp" #include "TracySourceContents.hpp" #include "TracyTimelineController.hpp" #include "TracyUserData.hpp" @@ -30,6 +29,10 @@ #include "../server/tracy_robin_hood.h" #include "../server/TracyVector.hpp" +#ifndef __EMSCRIPTEN__ +# include "TracyLlm.hpp" +#endif + namespace tracy { @@ -932,7 +935,9 @@ private: } } m_flameGraphInvariant; +#ifndef __EMSCRIPTEN__ TracyLlm m_llm; +#endif }; }