diff --git a/cmake/modules/FindV8.cmake b/cmake/modules/FindV8.cmake index a492cac24b..53fa880c87 100644 --- a/cmake/modules/FindV8.cmake +++ b/cmake/modules/FindV8.cmake @@ -91,7 +91,7 @@ else() endif() # V8 library paths -set(V8_LIBRARY_PATH_SUFFIXES lib lib64 lib/x86_64-linux-gnu lib.target) +#set(V8_LIBRARY_PATH_SUFFIXES lib lib64 lib/x86_64-linux-gnu lib.target) # Find include path if(MSVC OR CMAKE_BUILD_TYPE EQUAL "Debug") @@ -109,20 +109,20 @@ find_path(V8_INCLUDE_DIR ${V8_HEADERS} MESSAGE("V8 include dir: ${V8_INCLUDE_DIR}") # Define library names -set(V8_NAMES_DEBUG libnode libnode.so libnode.so.108 v8D v8_baseD v8_base.ia32D v8_base.x64D libv8_baseD v8_baseD.lib v8_libbaseD v8_libbase.ia32D v8_libbase.x64D libv8_libbaseD v8_libbaseD.lib) -set(V8_NAMES_RELEASE libnode libnode.so libnode.so.108 v8 v8_base v8_base.ia32 v8_base.x64 libv8_base v8_base.lib v8_libbase v8_libbase.ia32 v8_libbase.x64 libv8_libbase v8_libbase.lib) -set(V8_PLATFORM_NAMES_DEBUG libnode libnode.so libnode.so.108 v8_libplatformD v8_libplatformD.a v8_libplatformD.lib) -set(V8_PLATFORM_NAMES_RELEASE libnode libnode.so libnode.so.108 v8_libplatform v8_libplatform.a v8_libplatform.lib) -set(V8_SAMPLER_NAMES_DEBUG libnode libnode.so libnode.so.108 v8_libsamplerD v8_libsamplerD.a v8_libsamplerD.lib) -set(V8_SAMPLER_NAMES_RELEASE libnode libnode.so libnode.so.108 v8_libsampler v8_libsampler.a v8_libsampler.lib) -set(V8_SNAPSHOT_NAMES_DEBUG libnode libnode.so libnode.so.108 v8_snapshotD libv8_snapshotD v8_snapshotD.lib) -set(V8_SNAPSHOT_NAMES_RELEASE libnode libnode.so libnode.so.108 v8_snapshot libv8_snapshot v8_snapshot.lib) -set(V8_ICU_NAMES_DEBUG libnode libnode.so libnode.so.108 icudataD icudataD.a icudataD.lib) -set(V8_ICU_NAMES_RELEASE libnode libnode.so libnode.so.108 icudata icudata.a icudata.lib) -set(V8_ICUUC_NAMES_DEBUG libnode libnode.so libnode.so.108 icuucD libicuucD) -set(V8_ICUUC_NAMES_RELEASE libnode libnode.so libnode.so.108 icuuc libicuuc) -set(V8_ICUI18N_NAMES_DEBUG libnode libnode.so libnode.so.108 icui18nD libicui18nD) -set(V8_ICUI18N_NAMES_RELEASE libnode libnode.so libnode.so.108 icui18n libicui18n) +set(V8_NAMES_DEBUG libnode libnode.so libnode.lib libnode.so.108 v8D v8_baseD v8_base.ia32D v8_base.x64D libv8_baseD v8_baseD.lib v8_libbaseD v8_libbase.ia32D v8_libbase.x64D libv8_libbaseD v8_libbaseD.lib) +set(V8_NAMES_RELEASE libnode libnode.so libnode.lib libnode.so.108 v8 v8_base v8_base.ia32 v8_base.x64 libv8_base v8_base.lib v8_libbase v8_libbase.ia32 v8_libbase.x64 libv8_libbase v8_libbase.lib) +set(V8_PLATFORM_NAMES_DEBUG v8_libplatform.lib libnode libnode.so libnode.lib libnode.so.108 v8_libplatformD v8_libplatformD.a v8_libplatformD.lib) +set(V8_PLATFORM_NAMES_RELEASE v8_libplatform.lib libnode libnode.so libnode.lib libnode.so.108 v8_libplatform v8_libplatform.a) +set(V8_SAMPLER_NAMES_DEBUG libnode libnode.so libnode.lib libnode.so.108 v8_libsamplerD v8_libsamplerD.a v8_libsamplerD.lib) +set(V8_SAMPLER_NAMES_RELEASE libnode libnode.so libnode.lib libnode.so.108 v8_libsampler v8_libsampler.a v8_libsampler.lib) +set(V8_SNAPSHOT_NAMES_DEBUG libnode libnode.so libnode.lib libnode.so.108 v8_snapshotD libv8_snapshotD v8_snapshotD.lib) +set(V8_SNAPSHOT_NAMES_RELEASE libnode libnode.so libnode.lib libnode.so.108 v8_snapshot libv8_snapshot v8_snapshot.lib) +set(V8_ICU_NAMES_DEBUG libnode libnode.so libnode.lib libnode.so.108 icudataD icudataD.a icudataD.lib) +set(V8_ICU_NAMES_RELEASE libnode libnode.so libnode.lib libnode.so.108 icudata icudata.a icudata.lib) +set(V8_ICUUC_NAMES_DEBUG libnode libnode.so libnode.lib libnode.so.108 icuucD libicuucD) +set(V8_ICUUC_NAMES_RELEASE libnode libnode.so libnode.lib libnode.so.108 icuuc libicuuc) +set(V8_ICUI18N_NAMES_DEBUG libnode libnode.so libnode.lib libnode.so.108 icui18nD libicui18nD) +set(V8_ICUI18N_NAMES_RELEASE libnode libnode.so libnode.lib libnode.so.108 icui18n libicui18n) # Find V8 base library debug find_library(V8_LIBRARY_DEBUG diff --git a/cmake/ports/hifi-deps/CONTROL b/cmake/ports/hifi-deps/CONTROL index cf603b9869..ee9f4cf1b3 100644 --- a/cmake/ports/hifi-deps/CONTROL +++ b/cmake/ports/hifi-deps/CONTROL @@ -5,4 +5,4 @@ Source: hifi-deps Version: 0.1.5-github-actions Description: Collected dependencies for High Fidelity applications -Build-Depends: bullet3, draco, etc2comp, glad, glm, node, nvtt, openexr (!android), openssl (windows), opus, polyvox, tbb (!android), v8(windows), vhacd, webrtc (!android|!(linux&arm)), zlib +Build-Depends: bullet3, draco, etc2comp, glad, glm, node, nvtt, openexr (!android), openssl (windows), opus, polyvox, tbb (!android), vhacd, webrtc (!android|!(linux&arm)), zlib diff --git a/cmake/ports/node/portfile.cmake b/cmake/ports/node/portfile.cmake index 2a4ed5a905..d93ded9d1c 100644 --- a/cmake/ports/node/portfile.cmake +++ b/cmake/ports/node/portfile.cmake @@ -11,9 +11,10 @@ if (ANDROID) elseif (WIN32) vcpkg_download_distfile( NODE_SOURCE_ARCHIVE - URLS "${EXTERNAL_BUILD_ASSETS}/dependencies/node/node-install-18.14.2-windows-amd64-release.tar.xz" - SHA512 TODO - FILENAME node-install-18.14.2-windows-amd64-release.tar.xz + #URLS "${EXTERNAL_BUILD_ASSETS}/dependencies/node/node-install-18.14.2-windows-amd64-release.tar.xz" + URLS "http://oaktown.pl/tmp/node-install-18.15.1-win-x64-release.tar.xz" + SHA512 892608a43ae32b0a82a0e3c7994934d0ce85639ea372c8e7feb7de44220211fa91878bd0744e1488054777807dd5b0c0677b59b44ab5e9fd35ecf222b38d8046 + FILENAME node-install-18.15.1-win-x64-release.tar.xz ) elseif (APPLE) vcpkg_download_distfile( @@ -34,7 +35,16 @@ endif () vcpkg_extract_source_archive(MASTER_COPY_SOURCE_PATH ARCHIVE ${NODE_SOURCE_ARCHIVE} NO_REMOVE_ONE_LEVEL) -file(COPY ${MASTER_COPY_SOURCE_PATH}/node-install/include DESTINATION ${CURRENT_PACKAGES_DIR}) -file(COPY ${MASTER_COPY_SOURCE_PATH}/node-install/lib DESTINATION ${CURRENT_PACKAGES_DIR}) -file(COPY ${MASTER_COPY_SOURCE_PATH}/node-install/share DESTINATION ${CURRENT_PACKAGES_DIR}) -file(COPY ${MASTER_COPY_SOURCE_PATH}/node-install/bin DESTINATION ${CURRENT_PACKAGES_DIR}) +# move WIN dll to /bin and WIN .lib to /lib + +if (WIN32) + file(COPY ${MASTER_COPY_SOURCE_PATH}/node-install/include DESTINATION ${CURRENT_PACKAGES_DIR}) + file(COPY ${MASTER_COPY_SOURCE_PATH}/node-install/libnode.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(COPY ${MASTER_COPY_SOURCE_PATH}/node-install/v8_libplatform.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib) + file(COPY ${MASTER_COPY_SOURCE_PATH}/node-install/libnode.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin) +else () + file(COPY ${MASTER_COPY_SOURCE_PATH}/node-install/include DESTINATION ${CURRENT_PACKAGES_DIR}) + file(COPY ${MASTER_COPY_SOURCE_PATH}/node-install/lib DESTINATION ${CURRENT_PACKAGES_DIR}) + file(COPY ${MASTER_COPY_SOURCE_PATH}/node-install/share DESTINATION ${CURRENT_PACKAGES_DIR}) + file(COPY ${MASTER_COPY_SOURCE_PATH}/node-install/bin DESTINATION ${CURRENT_PACKAGES_DIR}) +endif () diff --git a/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.cpp b/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.cpp index 46ad1edc6f..a5c51803f9 100644 --- a/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.cpp +++ b/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.cpp @@ -346,7 +346,12 @@ namespace scriptable { #endif if (auto tmp = qobject_cast(obj)) { //out = QPointer(tmp); - dest.template setValue(QPointer(tmp)); +#if defined(Q_OS_WIN) || defined(Q_OS_MAC) + dest.setValue(QPointer(tmp)); +#else + //V8TODO: works on Linux but not Windows? + //dest.template setValue(QPointer(tmp)); +#endif return true; } #if 0 diff --git a/libraries/script-engine/src/v8/ScriptEngineV8.cpp b/libraries/script-engine/src/v8/ScriptEngineV8.cpp index 16fef8902c..bf3750ef4f 100644 --- a/libraries/script-engine/src/v8/ScriptEngineV8.cpp +++ b/libraries/script-engine/src/v8/ScriptEngineV8.cpp @@ -1190,7 +1190,8 @@ void ScriptEngineV8::updateMemoryCost(const qint64& deltaSize) { if (deltaSize > 0) { // We've patched qt to fix https://highfidelity.atlassian.net/browse/BUGZ-46 on mac and windows only. #if defined(Q_OS_WIN) || defined(Q_OS_MAC) - reportAdditionalMemoryCost(deltaSize); + // V8TODO: it seems to be broken in V8 branch on Windows for some reason + //reportAdditionalMemoryCost(deltaSize); #endif } } diff --git a/tools/node-builder/README.md b/tools/node-builder/README.md index d1498735f0..b34624c190 100644 --- a/tools/node-builder/README.md +++ b/tools/node-builder/README.md @@ -8,7 +8,8 @@ Reference: https://github.com/nodejs/node/blob/main/BUILDING.md ## Requirements ### Windows -TODO +1. git +2. nasm-2.16.01-installer-x64.exe ### Linux 1. git @@ -28,6 +29,13 @@ Before running configure, make sure that the node-build folder is empty. ### Windows Make sure that the directory you are using to build Node is not deeply nested. It is quite possible to run into the windows MAX_PATH limit when building Node. For example: `c:\msys64\home\ajt\code\hifi\tools\node-builder\node-build` is too long. `c:\n\node-build\` is a better choice. +Build: +'.\vcbuild.bat release package dll nonpm' + +Rename the installation directory to 'node-build' + +After building copy 'deps\v8\include\cppgc' and 'deps\v8\include\libplatform' to 'node-build\include'. +Copy 'libnode.lib' and 'v8_libplatform.lib' to 'node-build' #### Preparing source files Get the source: @@ -41,7 +49,7 @@ TODO #### Uploading -Create an xz tar file called node-install-18.14.2-windows-release.tar.gz from the node-install folder. +Create a xz tar file called node-install-18.14.2-windows-release.tar.gz from the node-install folder. Using 7-Zip: * `cd` to the *qt5* folder.