Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit a784e80

Browse files
committed
fix: electron build is broken on Windows
1 parent 73e631b commit a784e80

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

cortex-cpp/CMakeLists.txt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ project(cortex-cpp C CXX)
44

55
# Build using CMAKE-JS
66
if(DEFINED CMAKE_JS_INC)
7+
if(WIN32)
78
add_definitions(
89
-DV8_COMPRESS_POINTERS
910
-DV8_REVERSE_JSARGS
1011
-DV8_COMPRESS_POINTERS_IN_ISOLATE_CAGE
1112
)
13+
endif()
1214
include_directories(${CMAKE_JS_INC})
1315
endif()
1416

@@ -84,14 +86,16 @@ if(DEFINED CMAKE_JS_INC)
8486
${CMAKE_JS_SRC}
8587
)
8688

87-
target_link_libraries(${PROJECT_NAME}
88-
PRIVATE
89-
msvcprt.lib
90-
msvcrt.lib
91-
vcruntime.lib
92-
ucrt.lib
93-
${CMAKE_JS_LIB}
94-
)
89+
if(WIN32)
90+
target_link_libraries(${PROJECT_NAME}
91+
PRIVATE
92+
msvcprt.lib
93+
msvcrt.lib
94+
vcruntime.lib
95+
ucrt.lib
96+
${CMAKE_JS_LIB}
97+
)
98+
endif()
9599
else() # Official build
96100
add_executable(${PROJECT_NAME} main.cc
97101
${CMAKE_CURRENT_SOURCE_DIR}/utils/cpuid/cpu_info.cc

cortex-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"class-transformer": "^0.5.1",
5555
"class-validator": "^0.14.1",
5656
"cli-progress": "^3.12.0",
57-
"cortex-cpp": "0.4.25",
57+
"cortex-cpp": "0.4.34",
5858
"cortexso-node": "^0.0.4",
5959
"cpu-instructions": "^0.0.11",
6060
"decompress": "^4.2.1",

cortex-js/src/usecases/chat/chat.usecases.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ export class ChatUsecases {
5050
throw new Error(`No engine found with name: ${model.engine}`);
5151
}
5252
try {
53-
return await engine.inference(createChatDto, headers);
53+
return await engine.inference(
54+
{ ...createChatDto, engine: model.engine },
55+
headers,
56+
);
5457
} catch (error) {
5558
await this.telemetryUseCases.createCrashReport(
5659
error,

0 commit comments

Comments
 (0)