diff --git a/unity/native_src/CMakeLists.txt b/unity/native_src/CMakeLists.txt index 37ff50dbf4..c9e5b53983 100644 --- a/unity/native_src/CMakeLists.txt +++ b/unity/native_src/CMakeLists.txt @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 2.8) -if ( WIN32 AND NOT CYGWIN AND NOT ( CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" ) AND NOT ANDROID) +if ( WIN32 AND NOT CYGWIN AND NOT ( CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" ) AND NOT ANDROID AND NOT MSYS) set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT" CACHE STRING "") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd" CACHE STRING "") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT" CACHE STRING "") @@ -31,7 +31,14 @@ find_path(PUERTS_PROJECT_DIR NAMES SConstruct MARK_AS_ADVANCED(PUERTS_PROJECT_DIR) -set(V8_ENGINE ${CMAKE_SOURCE_DIR}/v8) +if ( JS_ENGINE STREQUAL "quickjs") +set(LIB_FILE_NAME libquickjs.a) +else() +set(JS_ENGINE v8) +set(LIB_FILE_NAME libwee8.a) +endif() + +set(V8_ENGINE ${CMAKE_SOURCE_DIR}/${JS_ENGINE}) set(V8_INC ${V8_ENGINE}/Inc) @@ -109,35 +116,68 @@ if ( WIN32 AND NOT CYGWIN ) target_compile_definitions (puerts PRIVATE BUILDING_V8_SHARED) endif ( ) -if ( WIN32 ) +if ( JS_ENGINE STREQUAL "quickjs") + target_compile_definitions (puerts PRIVATE WITHOUT_INSPECTOR) +endif ( ) + +if (MSYS) if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") target_link_libraries(puerts - ${V8_ENGINE}/Lib/Win32/wee8.lib - winmm.lib - dbghelp.lib - shlwapi.lib + ${V8_ENGINE}/Lib/Win32/${LIB_FILE_NAME} ) else () target_link_libraries(puerts - ${V8_ENGINE}/Lib/Win64/wee8.lib - winmm.lib - dbghelp.lib - shlwapi.lib + ${V8_ENGINE}/Lib/Win64/${LIB_FILE_NAME} ) endif () target_compile_definitions (puerts PRIVATE PLATFORM_WINDOWS) +elseif ( WIN32 ) + if ( JS_ENGINE STREQUAL "quickjs") + if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") + target_link_libraries(puerts + ${V8_ENGINE}/Lib/Win32/quickjs.dll.lib + winmm.lib + dbghelp.lib + shlwapi.lib + ) + else () + target_link_libraries(puerts + ${V8_ENGINE}/Lib/Win64/quickjs.dll.lib + winmm.lib + dbghelp.lib + shlwapi.lib + ) + endif () + else () + if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") + target_link_libraries(puerts + ${V8_ENGINE}/Lib/Win32/wee8.lib + winmm.lib + dbghelp.lib + shlwapi.lib + ) + else () + target_link_libraries(puerts + ${V8_ENGINE}/Lib/Win64/wee8.lib + winmm.lib + dbghelp.lib + shlwapi.lib + ) + endif () + endif () + target_compile_definitions (puerts PRIVATE PLATFORM_WINDOWS) elseif ( ANDROID ) find_library(log-lib log ) if( ANDROID_ABI STREQUAL "armeabi-v7a") target_link_libraries(puerts - ${V8_ENGINE}/Lib/Android/armv7/libwee8.a + ${V8_ENGINE}/Lib/Android/armv7/${LIB_FILE_NAME} ${log-lib} ) target_compile_definitions (puerts PRIVATE PLATFORM_ANDROID_ARM) else ( ) target_link_libraries(puerts - ${V8_ENGINE}/Lib/Android/arm64/libwee8.a + ${V8_ENGINE}/Lib/Android/arm64/${LIB_FILE_NAME} ${log-lib} ) target_compile_definitions (puerts PRIVATE PLATFORM_ANDROID_ARM64) @@ -155,7 +195,7 @@ elseif ( APPLE ) target_compile_definitions (puerts PRIVATE PLATFORM_IOS) else () target_link_libraries(puerts - ${V8_ENGINE}/Lib/macOS/libwee8.a + ${V8_ENGINE}/Lib/macOS/${LIB_FILE_NAME} ) target_compile_definitions (puerts PRIVATE PLATFORM_MAC) endif ( ) diff --git a/unity/native_src/make_win64_qjs.bat b/unity/native_src/make_win64_qjs.bat new file mode 100644 index 0000000000..b644db9f89 --- /dev/null +++ b/unity/native_src/make_win64_qjs.bat @@ -0,0 +1,5 @@ +mkdir build64qjs & pushd build64qjs +cmake -DJS_ENGINE=quickjs -G "Visual Studio 16 2019" -A x64 .. +popd +cmake --build build64qjs --config Release +pause diff --git a/unreal/Puerts/Source/JsEnv/Private/V8InspectorImpl.cpp b/unreal/Puerts/Source/JsEnv/Private/V8InspectorImpl.cpp index 8f1d6be41c..e61db0c705 100644 --- a/unreal/Puerts/Source/JsEnv/Private/V8InspectorImpl.cpp +++ b/unreal/Puerts/Source/JsEnv/Private/V8InspectorImpl.cpp @@ -11,7 +11,7 @@ #define USING_UE 0 #endif -#if PLATFORM_WINDOWS || PLATFORM_MAC +#if (PLATFORM_WINDOWS || PLATFORM_MAC || WITH_INSPECTOR) && !WITHOUT_INSPECTOR #include "V8InspectorImpl.h"