From 73e631bb87cb6a9cdaf9aa68bab916c20a22fb25 Mon Sep 17 00:00:00 2001 From: Louis Le Date: Wed, 24 Jul 2024 10:55:27 +0700 Subject: [PATCH] fix: electron build --- cortex-cpp/CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cortex-cpp/CMakeLists.txt b/cortex-cpp/CMakeLists.txt index 031428263..1800cc8e7 100644 --- a/cortex-cpp/CMakeLists.txt +++ b/cortex-cpp/CMakeLists.txt @@ -4,6 +4,11 @@ project(cortex-cpp C CXX) # Build using CMAKE-JS if(DEFINED CMAKE_JS_INC) + add_definitions( + -DV8_COMPRESS_POINTERS + -DV8_REVERSE_JSARGS + -DV8_COMPRESS_POINTERS_IN_ISOLATE_CAGE + ) include_directories(${CMAKE_JS_INC}) endif() @@ -76,6 +81,16 @@ if(DEFINED CMAKE_JS_INC) add_library(${PROJECT_NAME} SHARED addon.cc ${CMAKE_CURRENT_SOURCE_DIR}/utils/cpuid/cpu_info.cc + ${CMAKE_JS_SRC} + ) + + target_link_libraries(${PROJECT_NAME} + PRIVATE + msvcprt.lib + msvcrt.lib + vcruntime.lib + ucrt.lib + ${CMAKE_JS_LIB} ) else() # Official build add_executable(${PROJECT_NAME} main.cc