Fix emscripten build.

This commit is contained in:
Bartosz Taudul
2025-07-12 18:19:56 +02:00
parent e77240a47d
commit b58388316a
3 changed files with 12 additions and 10 deletions

View File

@@ -194,6 +194,15 @@ CPMAddPackage(
EXCLUDE_FROM_ALL TRUE
)
# json
CPMAddPackage(
NAME json
GITHUB_REPOSITORY nlohmann/json
GIT_TAG v3.12.0
EXCLUDE_FROM_ALL TRUE
)
if(NOT EMSCRIPTEN)
# base64
@@ -222,15 +231,6 @@ if(NOT EMSCRIPTEN)
EXCLUDE_FROM_ALL TRUE
)
# json
CPMAddPackage(
NAME json
GITHUB_REPOSITORY nlohmann/json
GIT_TAG v3.12.0
EXCLUDE_FROM_ALL TRUE
)
# usearch
CPMAddPackage(

View File

@@ -240,6 +240,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
TracyServer
TracyImGui
Threads::Threads
nlohmann_json::nlohmann_json
)
target_include_directories(${PROJECT_NAME} PRIVATE
${tidy_SOURCE_DIR}/include
@@ -250,7 +251,6 @@ if(NOT EMSCRIPTEN)
base64
tidy-static
TracyPugixml
nlohmann_json::nlohmann_json
usearch
md4c
)

View File

@@ -1468,8 +1468,10 @@ bool View::WasActive() const
void View::AddLlmAttachment( const nlohmann::json& json )
{
#ifndef __EMSCRIPTEN__
m_llm.AddAttachment( json.dump( 2 ), "user" );
m_llm.m_show = true;
#endif
}
}