Initial VCPKG Node/v8 packaging

This commit is contained in:
Julian Groß 2023-02-28 21:12:14 +01:00 committed by ksuprynowicz
parent 3e7bdad500
commit b650da7fc9
18 changed files with 234 additions and 1009 deletions

View file

@ -47,6 +47,7 @@ include(FindPackageHandleStandardArgs)
# V8 search paths
set(V8_PATHS
${VCPKG_INSTALL_ROOT}
${V8_HOME}
${V8_ROOT}
$ENV{ProgramFiles}/v8
@ -108,20 +109,20 @@ find_path(V8_INCLUDE_DIR ${V8_HEADERS}
MESSAGE("V8 include dir: ${V8_INCLUDE_DIR}")
# Define library names
set(V8_NAMES_DEBUG 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 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_libplatformD v8_libplatformD.a v8_libplatformD.lib)
set(V8_PLATFORM_NAMES_RELEASE v8_libplatform v8_libplatform.a v8_libplatform.lib)
set(V8_SAMPLER_NAMES_DEBUG v8_libsamplerD v8_libsamplerD.a v8_libsamplerD.lib)
set(V8_SAMPLER_NAMES_RELEASE v8_libsampler v8_libsampler.a v8_libsampler.lib)
set(V8_SNAPSHOT_NAMES_DEBUG v8_snapshotD libv8_snapshotD v8_snapshotD.lib)
set(V8_SNAPSHOT_NAMES_RELEASE v8_snapshot libv8_snapshot v8_snapshot.lib)
set(V8_ICU_NAMES_DEBUG icudataD icudataD.a icudataD.lib)
set(V8_ICU_NAMES_RELEASE icudata icudata.a icudata.lib)
set(V8_ICUUC_NAMES_DEBUG icuucD libicuucD)
set(V8_ICUUC_NAMES_RELEASE icuuc libicuuc)
set(V8_ICUI18N_NAMES_DEBUG icui18nD libicui18nD)
set(V8_ICUI18N_NAMES_RELEASE icui18n libicui18n)
set(V8_NAMES_DEBUG libnode 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 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 v8_libplatformD v8_libplatformD.a v8_libplatformD.lib)
set(V8_PLATFORM_NAMES_RELEASE libnode v8_libplatform v8_libplatform.a v8_libplatform.lib)
set(V8_SAMPLER_NAMES_DEBUG libnode v8_libsamplerD v8_libsamplerD.a v8_libsamplerD.lib)
set(V8_SAMPLER_NAMES_RELEASE libnode v8_libsampler v8_libsampler.a v8_libsampler.lib)
set(V8_SNAPSHOT_NAMES_DEBUG libnode v8_snapshotD libv8_snapshotD v8_snapshotD.lib)
set(V8_SNAPSHOT_NAMES_RELEASE libnode v8_snapshot libv8_snapshot v8_snapshot.lib)
set(V8_ICU_NAMES_DEBUG libnode icudataD icudataD.a icudataD.lib)
set(V8_ICU_NAMES_RELEASE libnode icudata icudata.a icudata.lib)
set(V8_ICUUC_NAMES_DEBUG libnode icuucD libicuucD)
set(V8_ICUUC_NAMES_RELEASE libnode icuuc libicuuc)
set(V8_ICUI18N_NAMES_DEBUG libnode icui18nD libicui18nD)
set(V8_ICUI18N_NAMES_RELEASE libnode icui18n libicui18n)
# Find V8 base library debug
find_library(V8_LIBRARY_DEBUG

View file

@ -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, 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), v8(windows), vhacd, webrtc (!android|!(linux&arm)), zlib

6
cmake/ports/node/CONTROL Normal file
View file

@ -0,0 +1,6 @@
# Copyright 2023 Overte e.V.
# SPDX-License-Identifier: MIT
Source: node
Version: 18.14.2-1
Homepage: https://nodejs.org/
Description: Node.js JavaScript runtime.

View file

@ -0,0 +1,40 @@
# Copyright 2023 Overte e.V.
# SPDX-License-Identifier: MIT
set(NODE_VERSION 18.14.2)
set(MASTER_COPY_SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src)
file(READ "${VCPKG_ROOT_DIR}/_env/EXTERNAL_BUILD_ASSETS.txt" EXTERNAL_BUILD_ASSETS)
if (ANDROID)
# TODO
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
)
elseif (APPLE)
vcpkg_download_distfile(
NODE_SOURCE_ARCHIVE
URLS "${EXTERNAL_BUILD_ASSETS}/dependencies/node/node-install-18.14.2-macOSXSDK10.14-macos-amd64-release.tar.xz"
SHA512 TODO
FILENAME node-install-18.14.2-macOSXSDK10.14-macos-amd64-release.tar.xz
)
else ()
# else Linux desktop
vcpkg_download_distfile(
NODE_SOURCE_ARCHIVE
URLS "${EXTERNAL_BUILD_ASSETS}/dependencies/node/node-install-18.14.2-ubuntu-18.04-amd64-release.tar.xz"
SHA512 ff5ca5c27b811d20ac524346ee122bcd72e9e85c6de6f4799f620bb95dac959ce910cc5bb2162ed741a7f65043aa78173ecd2ce5b92f5a4d91ecb07ce71fa560
FILENAME node-install-18.14.2-ubuntu-18.04-amd64-release.tar.xz
)
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})

View file

@ -1,111 +0,0 @@
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
include(SelectLibraryConfigurations)
find_path(V8_INCLUDE_DIR NAMES v8.h PATH_SUFFIXES include)
if(EXISTS ${_IMPORT_PREFIX}/bin/snapshot_blob.bin)
set(V8_SNAPSHOT_BLOB_RELEASE ${_IMPORT_PREFIX}/bin/snapshot_blob.bin CACHE FILEPATH "Release version of V8 snapshot blob location")
endif()
if(EXISTS ${_IMPORT_PREFIX}/debug/bin/snapshot_blob.bin)
set(V8_SNAPSHOT_BLOB_DEBUG ${_IMPORT_PREFIX}/debug/bin/snapshot_blob.bin CACHE FILEPATH "Debug version of V8 snapshot blob location")
endif()
set(V8_SNAPSHOT_BLOB "$<IF:$<CONFIG:Debug>,${V8_SNAPSHOT_BLOB_DEBUG},${V8_SNAPSHOT_BLOB_RELEASE}>")
if(EXISTS "${_IMPORT_PREFIX}/lib/v8${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(V8_LIBRARY_RELEASE "${_IMPORT_PREFIX}/lib/v8${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE FILEPATH "Release version of the V8 library location")
endif()
if(EXISTS "${_IMPORT_PREFIX}/debug/lib/v8${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(V8_LIBRARY_DEBUG "${_IMPORT_PREFIX}/debug/lib/v8${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE FILEPATH "Debug version of the V8 library location")
endif()
select_library_configurations(V8)
if(EXISTS "${_IMPORT_PREFIX}/lib/v8_libbase${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(V8LIBBASE_LIBRARY_RELEASE "${_IMPORT_PREFIX}/lib/v8_libbase${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE FILEPATH "Release version of the V8 libbase library location")
endif()
if(EXISTS "${_IMPORT_PREFIX}/debug/lib/v8_libbase${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(V8LIBBASE_LIBRARY_DEBUG "${_IMPORT_PREFIX}/debug/lib/v8_libbase${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE FILEPATH "Debug version of the V8 libbase library location")
endif()
select_library_configurations(V8LIBBASE)
if(EXISTS "${_IMPORT_PREFIX}/lib/v8_libplatform${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(V8LIBPLATFORM_LIBRARY_RELEASE "${_IMPORT_PREFIX}/lib/v8_libplatform${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE FILEPATH "Release version of the V8 libplatform library location")
endif()
if(EXISTS "${_IMPORT_PREFIX}/debug/lib/v8_libplatform${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(V8LIBPLATFORM_LIBRARY_DEBUG "${_IMPORT_PREFIX}/debug/lib/v8_libplatform${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE FILEPATH "Delete version of the V8 libplatform library location")
endif()
select_library_configurations(V8LIBPLATFORM)
mark_as_advanced(V8_INCLUDE_DIR)
if(V8_INCLUDE_DIR AND EXISTS "${V8_INCLUDE_DIR}/v8-version.h")
file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_MAJOR_VERSION REGEX "^#define V8_MAJOR_VERSION [0-9]+.*$")
string(REGEX REPLACE "^#define V8_MAJOR_VERSION ([0-9]+).*$" "\\1" V8_MAJOR_VERSION "${V8_MAJOR_VERSION}")
file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_MINOR_VERSION REGEX "^#define V8_MINOR_VERSION [0-9]+.*$")
string(REGEX REPLACE "^#define V8_MINOR_VERSION ([0-9]+).*$" "\\1" V8_MINOR_VERSION "${V8_MINOR_VERSION}")
file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_BUILD_NUMBER REGEX "^#define V8_BUILD_NUMBER [0-9]+.*$")
string(REGEX REPLACE "^#define V8_BUILD_NUMBER ([0-9]+).*$" "\\1" V8_BUILD_NUMBER "${V8_BUILD_NUMBER}")
file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_PATCH_LEVEL REGEX "^#define V8_PATCH_LEVEL [0-9]+.*$")
string(REGEX REPLACE "^#define V8_PATCH_LEVEL ([0-9]+).*$" "\\1" V8_PATCH_LEVEL "${V8_PATCH_LEVEL}")
set(V8_VERSION_STRING "${V8_MAJOR_VERSION}.${V8_MINOR_VERSION}.${V8_BUILD_NUMBER}.${V8_PATCH_LEVEL}")
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(V8_COMPILE_DEFINITIONS "V8_COMPRESS_POINTERS;V8_31BIT_SMIS_ON_64BIT_ARCH")
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(V8_COMPILE_DEFINITIONS " ")
endif()
mark_as_advanced(V8_COMPILE_DEFINITIONS)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(V8 REQUIRED_VARS V8_LIBRARY V8LIBBASE_LIBRARY V8LIBPLATFORM_LIBRARY V8_INCLUDE_DIR V8_COMPILE_DEFINITIONS
VERSION_VAR V8_VERSION_STRING)
set(V8_LIBRARIES ${V8_LIBRARY} ${V8LIBBASE_LIBRARY} ${V8LIBPLATFORM_LIBRARY})
mark_as_advanced(V8_LIBRARIES)
if(NOT TARGET V8::V8)
add_library(V8::V8 SHARED IMPORTED)
set_target_properties(V8::V8 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${V8_INCLUDE_DIR}"
INTERFACE_COMPILE_DEFINITIONS "${V8_COMPILE_DEFINITIONS}")
if(V8_LIBRARY_RELEASE)
set_property(TARGET V8::V8 APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(V8::V8 PROPERTIES
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/v8${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}"
IMPORTED_IMPLIB_RELEASE "${V8_LIBRARY_RELEASE}"
)
set_target_properties(V8::V8 PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE
"${V8LIBBASE_LIBRARY_RELEASE};${V8LIBPLATFORM_LIBRARY_RELEASE}")
endif()
if(V8_LIBRARY_DEBUG)
set_property(TARGET V8::V8 APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(V8::V8 PROPERTIES
IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/debug/bin/v8${CMAKE_SHARED_LIBRARY_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}"
IMPORTED_IMPLIB_DEBUG "${V8_LIBRARY_DEBUG}")
set_target_properties(V8::V8 PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG
"${V8LIBBASE_LIBRARY_DEBUG};${V8LIBPLATFORM_LIBRARY_DEBUG}")
endif()
if(NOT V8_LIBRARY_RELEASE AND NOT V8_LIBRARY_DEBUG)
set_property(TARGET V8::V8 APPEND PROPERTY
IMPORTED_IMPLIB "${V8_LIBRARY}")
set_target_properties(V8::V8 PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES
"${V8LIBBASE_LIBRARY};${V8LIBPLATFORM_LIBRARY}")
endif()
endif()

View file

@ -1,98 +0,0 @@
include(CMakeFindDependencyMacro)
find_dependency(ICU REQUIRED COMPONENTS in uc dt)
find_dependency(ZLIB REQUIRED)
if(UNIX)
find_package(PkgConfig REQUIRED)
pkg_check_modules(GLIB2 glib-2.0 gobject-2.0 gmodule-2.0 gio-2.0 IMPORTED_TARGET)
set(V8_IMPORTED_LINK_INTERFACE_LIBRARIES
"ICU::in;ICU::uc;ICU::dt;ZLIB::ZLIB")
elseif(WIN32)
set(V8_IMPORTED_LINK_INTERFACE_LIBRARIES
"Winmm;DbgHelp;ZLIB::ZLIB;ICU::in;ICU::uc;ICU::dt")
endif()
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
include(SelectLibraryConfigurations)
find_path(V8_INCLUDE_DIR NAMES v8.h PATH_SUFFIXES include)
if(EXISTS "${_IMPORT_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}v8_monolith${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(V8_LIBRARY_RELEASE "${_IMPORT_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}v8_monolith${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE FILEPATH "Release version of the V8 library location")
endif()
if(EXISTS "${_IMPORT_PREFIX}/debug/lib/${CMAKE_STATIC_LIBRARY_PREFIX}v8_monolith${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(V8_LIBRARY_DEBUG "${_IMPORT_PREFIX}/debug/lib/${CMAKE_STATIC_LIBRARY_PREFIX}v8_monolith${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE FILEPATH "Debug version of the V8 library location")
endif()
select_library_configurations(V8)
mark_as_advanced(V8_INCLUDE_DIR)
if(V8_INCLUDE_DIR AND EXISTS "${V8_INCLUDE_DIR}/v8-version.h")
file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_MAJOR_VERSION REGEX "^#define V8_MAJOR_VERSION [0-9]+.*$")
string(REGEX REPLACE "^#define V8_MAJOR_VERSION ([0-9]+).*$" "\\1" V8_MAJOR_VERSION "${V8_MAJOR_VERSION}")
file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_MINOR_VERSION REGEX "^#define V8_MINOR_VERSION [0-9]+.*$")
string(REGEX REPLACE "^#define V8_MINOR_VERSION ([0-9]+).*$" "\\1" V8_MINOR_VERSION "${V8_MINOR_VERSION}")
file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_BUILD_NUMBER REGEX "^#define V8_BUILD_NUMBER [0-9]+.*$")
string(REGEX REPLACE "^#define V8_BUILD_NUMBER ([0-9]+).*$" "\\1" V8_BUILD_NUMBER "${V8_BUILD_NUMBER}")
file(STRINGS "${V8_INCLUDE_DIR}/v8-version.h" V8_PATCH_LEVEL REGEX "^#define V8_PATCH_LEVEL [0-9]+.*$")
string(REGEX REPLACE "^#define V8_PATCH_LEVEL ([0-9]+).*$" "\\1" V8_PATCH_LEVEL "${V8_PATCH_LEVEL}")
set(V8_VERSION_STRING "${V8_MAJOR_VERSION}.${V8_MINOR_VERSION}.${V8_BUILD_NUMBER}.${V8_PATCH_LEVEL}")
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(V8_COMPILE_DEFINITIONS "V8_COMPRESS_POINTERS;V8_31BIT_SMIS_ON_64BIT_ARCH")
else()
set(V8_COMPILE_DEFINITIONS " ")
endif()
mark_as_advanced(V8_COMPILE_DEFINITIONS)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(V8 REQUIRED_VARS V8_LIBRARY V8_INCLUDE_DIR V8_COMPILE_DEFINITIONS
VERSION_VAR V8_VERSION_STRING)
set(V8_LIBRARIES ${V8_LIBRARY})
mark_as_advanced(V8_LIBRARIES)
if(NOT TARGET V8::V8)
add_library(V8::V8 STATIC IMPORTED)
set_target_properties(V8::V8 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${V8_INCLUDE_DIR}"
INTERFACE_COMPILE_DEFINITIONS "${V8_COMPILE_DEFINITIONS}")
if(MSVC)
set_target_properties(V8::V8 PROPERTIES
INTERFACE_COMPILE_OPTIONS "/MT$<$<CONFIG:Debug>:d>")
endif()
if(V8_LIBRARY_RELEASE)
set_property(TARGET V8::V8 APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(V8::V8 PROPERTIES
IMPORTED_LOCATION_RELEASE "${V8_LIBRARY_RELEASE}"
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE
"${V8_IMPORTED_LINK_INTERFACE_LIBRARIES}")
endif()
if(V8_LIBRARY_DEBUG)
set_property(TARGET V8::V8 APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(V8::V8 PROPERTIES
IMPORTED_LOCATION_DEBUG "${V8_LIBRARY_DEBUG}"
IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG
"${V8_IMPORTED_LINK_INTERFACE_LIBRARIES}")
endif()
if(NOT V8_LIBRARY_RELEASE AND NOT V8_LIBRARY_DEBUG)
set_property(TARGET V8::V8 APPEND PROPERTY
IMPORTED_LOCATION "${V8_LIBRARY}"
IMPORTED_LINK_INTERFACE_LIBRARIES
"${V8_IMPORTED_LINK_INTERFACE_LIBRARIES}")
endif()
endif()

View file

@ -1,187 +0,0 @@
diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn
index 1904a2559..e66586c88 100644
--- a/config/compiler/BUILD.gn
+++ b/config/compiler/BUILD.gn
@@ -1571,6 +1571,7 @@ config("default_warnings") {
# Disables.
"-Wno-missing-field-initializers", # "struct foo f = {0};"
"-Wno-unused-parameter", # Unused function parameters.
+ "-Wno-invalid-offsetof", # Use of "conditionally-supported" offsetof in c++17
]
}
@@ -1987,8 +1988,17 @@ config("no_incompatible_pointer_warnings") {
# Shared settings for both "optimize" and "optimize_max" configs.
# IMPORTANT: On Windows "/O1" and "/O2" must go before the common flags.
if (is_win) {
- common_optimize_on_cflags = [
- "/Ob2", # Both explicit and auto inlining.
+ common_optimize_on_cflags = []
+ if(is_clang) {
+ common_optimize_on_cflags += [
+ "/Ob2", # Both explicit and auto inlining.
+ ]
+ } else {
+ common_optimize_on_cflags += [
+ "/Ob3", # Both explicit and auto inlining.
+ ]
+ }
+ common_optimize_on_cflags += [
"/Oy-", # Disable omitting frame pointers, must be after /O2.
"/Zc:inline", # Remove unreferenced COMDAT (faster links).
]
diff --git a/config/linux/pkg-config.py b/config/linux/pkg-config.py
index 5adf70cc3..dab159f98 100755
--- a/config/linux/pkg-config.py
+++ b/config/linux/pkg-config.py
@@ -41,6 +41,11 @@ from optparse import OptionParser
# Additionally, you can specify the option --atleast-version. This will skip
# the normal outputting of a dictionary and instead print true or false,
# depending on the return value of pkg-config for the given package.
+#
+# --pkg_config_libdir=<path> allows direct override
+# of the PKG_CONFIG_LIBDIR environment library.
+#
+# --full-path-libs causes lib names to include their full path.
def SetConfigPath(options):
@@ -105,11 +110,32 @@ def RewritePath(path, strip_prefix, sysroot):
return path
+flag_regex = re.compile("(-.)(.+)")
+
+
+def FlagReplace(matchobj):
+ if matchobj.group(1) == '-I':
+ return matchobj.group(1) + subprocess.check_output([u'cygpath',u'-w',matchobj.group(2)]).strip().decode("utf-8")
+ if matchobj.group(1) == '-L':
+ return matchobj.group(1) + subprocess.check_output([u'cygpath',u'-w',matchobj.group(2)]).strip().decode("utf-8")
+ if matchobj.group(1) == '-l':
+ return matchobj.group(1) + matchobj.group(2) + '.lib'
+ return matchobj.group(0)
+
+
+def ConvertGCCToMSVC(flags):
+ """Rewrites GCC flags into MSVC flags."""
+ # need a better way to determine mingw vs msvc build
+ if 'win32' not in sys.platform or "GCC" in sys.version:
+ return flags
+ return [ flag_regex.sub(FlagReplace,flag) for flag in flags]
+
+
def main():
# If this is run on non-Linux platforms, just return nothing and indicate
# success. This allows us to "kind of emulate" a Linux build from other
# platforms.
- if "linux" not in sys.platform:
+ if "linux" not in sys.platform and 'win32' not in sys.platform:
print("[[],[],[],[],[]]")
return 0
@@ -128,6 +154,9 @@ def main():
parser.add_option('--dridriverdir', action='store_true', dest='dridriverdir')
parser.add_option('--version-as-components', action='store_true',
dest='version_as_components')
+ parser.add_option('--pkg_config_libdir', action='store', dest='pkg_config_libdir',
+ type='string')
+ parser.add_option('--full-path-libs', action='store_true', dest='full_path_libs')
(options, args) = parser.parse_args()
# Make a list of regular expressions to strip out.
@@ -144,6 +173,10 @@ def main():
else:
prefix = ''
+ # Override PKG_CONFIG_LIBDIR
+ if options.pkg_config_libdir:
+ os.environ['PKG_CONFIG_LIBDIR'] = options.pkg_config_libdir
+
if options.atleast_version:
# When asking for the return value, just run pkg-config and print the return
# value, no need to do other work.
@@ -203,7 +236,7 @@ def main():
# For now just split on spaces to get the args out. This will break if
# pkgconfig returns quoted things with spaces in them, but that doesn't seem
# to happen in practice.
- all_flags = flag_string.strip().split(' ')
+ all_flags = ConvertGCCToMSVC(flag_string.strip().split(' '))
sysroot = options.sysroot
@@ -220,7 +253,10 @@ def main():
continue;
if flag[:2] == '-l':
- libs.append(RewritePath(flag[2:], prefix, sysroot))
+ library = RewritePath(flag[2:], prefix, sysroot)
+ # Skip math library on MSVC
+ if library != 'm.lib':
+ libs.append(library)
elif flag[:2] == '-L':
lib_dirs.append(RewritePath(flag[2:], prefix, sysroot))
elif flag[:2] == '-I':
@@ -237,6 +273,14 @@ def main():
else:
cflags.append(flag)
+ if options.full_path_libs:
+ full_path_libs = []
+ for lib_dir in lib_dirs:
+ for lib in libs:
+ if os.path.isfile(lib_dir+"/"+lib):
+ full_path_libs.append(lib_dir+"/"+lib)
+ libs = full_path_libs
+
# Output a GN array, the first one is the cflags, the second are the libs. The
# JSON formatter prints GN compatible lists when everything is a list of
# strings.
diff --git a/config/linux/pkg_config.gni b/config/linux/pkg_config.gni
index 428e44ac0..a0d2175ee 100644
--- a/config/linux/pkg_config.gni
+++ b/config/linux/pkg_config.gni
@@ -45,6 +45,9 @@ declare_args() {
# in similar fashion by setting the `system_libdir` variable in the build's
# args.gn file to 'lib' or 'lib64' as appropriate for the target architecture.
system_libdir = "lib"
+
+ # Allow directly overriding the PKG_CONFIG_LIBDIR enviroment variable
+ pkg_config_libdir = ""
}
pkg_config_script = "//build/config/linux/pkg-config.py"
@@ -87,6 +90,17 @@ if (host_pkg_config != "") {
host_pkg_config_args = pkg_config_args
}
+if (pkg_config_libdir != "") {
+ pkg_config_args += [
+ "--pkg_config_libdir",
+ pkg_config_libdir,
+ ]
+ host_pkg_config_args += [
+ "--pkg_config_libdir",
+ pkg_config_libdir,
+ ]
+}
+
template("pkg_config") {
assert(defined(invoker.packages),
"Variable |packages| must be defined to be a list in pkg_config.")
diff --git a/util/lastchange.py b/util/lastchange.py
index 02a36642b..78934f1b0 100755
--- a/util/lastchange.py
+++ b/util/lastchange.py
@@ -192,7 +192,10 @@ def GetGitTopDirectory(source_dir):
Returns:
The output of "git rev-parse --show-toplevel" as a string
"""
- return _RunGitCommand(source_dir, ['rev-parse', '--show-toplevel'])
+ directory = _RunGitCommand(source_dir, ['rev-parse', '--show-toplevel'])
+ if "GCC" in sys.version and sys.platform=='win32':
+ return subprocess.check_output(["cygpath", "-w", directory]).strip(b"\n").decode()
+ return directory
def WriteIfChanged(file_name, contents):

View file

@ -1,71 +0,0 @@
import("//build/config/linux/pkg_config.gni")
declare_args() {
# Tells icu to load an external data file rather than rely on the icudata
# being linked directly into the binary.
icu_use_data_file = true
# If true, compile icu into a standalone static library. Currently this is
# only useful on Chrome OS.
icu_disable_thin_archive = false
}
pkg_config("system_icui18n") {
packages = [ "icu-i18n" ]
if (is_win) {
extra_args = ["--full-path-libs"] # Workaround the WinSDK having an older version of ICU
}
}
pkg_config("system_icuuc") {
packages = [ "icu-uc" ]
if (is_win) {
extra_args = ["--full-path-libs"] # Workaround the WinSDK having an older version of ICU
}
}
group("icu") {
public_deps = [
":icui18n",
":icuuc",
]
}
config("icu_config") {
defines = [
"USING_SYSTEM_ICU=1",
]
if(is_win){
if(!is_component_build) {
ldflags = ["/ignore:4099"] # needed on CI builds
}
defines += [ "UCHAR_TYPE=wchar_t" ]
}
else{
defines += [ "UCHAR_TYPE=uint16_t" ]
}
if (icu_use_data_file) {
defines += [ "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE" ]
} else {
defines += [ "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC" ]
}
}
source_set("icui18n") {
public_configs = [
":icu_config",
":system_icui18n"
]
}
source_set("icuuc") {
public_configs = [
":icu_config",
":system_icuuc"
]
}
source_set("icudata") {
public_configs = [
":icu_config",
]
}

View file

@ -1,198 +0,0 @@
set(pkgver "9.1.269.39")
set(ENV{DEPOT_TOOLS_WIN_TOOLCHAIN} 0)
get_filename_component(GIT_PATH ${GIT} DIRECTORY)
vcpkg_find_acquire_program(PYTHON2)
get_filename_component(PYTHON2_PATH ${PYTHON2} DIRECTORY)
vcpkg_find_acquire_program(GN)
get_filename_component(GN_PATH ${GN} DIRECTORY)
vcpkg_find_acquire_program(NINJA)
get_filename_component(NINJA_PATH ${NINJA} DIRECTORY)
vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/bin")
vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/debug/bin")
vcpkg_add_to_path(PREPEND "${GIT_PATH}")
vcpkg_add_to_path(PREPEND "${PYTHON2_PATH}")
vcpkg_add_to_path(PREPEND "${GN_PATH}")
vcpkg_add_to_path(PREPEND "${NINJA_PATH}")
if(WIN32)
vcpkg_acquire_msys(MSYS_ROOT PACKAGES pkg-config)
vcpkg_add_to_path("${MSYS_ROOT}/usr/bin")
endif()
set(VCPKG_KEEP_ENV_VARS PATH;DEPOT_TOOLS_WIN_TOOLCHAIN)
function(v8_fetch)
set(oneValueArgs DESTINATION URL REF SOURCE)
set(multipleValuesArgs PATCHES)
cmake_parse_arguments(V8 "" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN})
if(NOT DEFINED V8_DESTINATION)
message(FATAL_ERROR "DESTINATION must be specified.")
endif()
if(NOT DEFINED V8_URL)
message(FATAL_ERROR "The git url must be specified")
endif()
if(NOT DEFINED V8_REF)
message(FATAL_ERROR "The git ref must be specified.")
endif()
if(EXISTS ${V8_SOURCE}/${V8_DESTINATION})
vcpkg_execute_required_process(
COMMAND ${GIT} reset --hard
WORKING_DIRECTORY ${V8_SOURCE}/${V8_DESTINATION}
LOGNAME build-${TARGET_TRIPLET})
else()
vcpkg_execute_required_process(
COMMAND ${GIT} clone --depth 1 ${V8_URL} ${V8_DESTINATION}
WORKING_DIRECTORY ${V8_SOURCE}
LOGNAME build-${TARGET_TRIPLET})
vcpkg_execute_required_process(
COMMAND ${GIT} fetch --depth 1 origin ${V8_REF}
WORKING_DIRECTORY ${V8_SOURCE}/${V8_DESTINATION}
LOGNAME build-${TARGET_TRIPLET})
vcpkg_execute_required_process(
COMMAND ${GIT} checkout FETCH_HEAD
WORKING_DIRECTORY ${V8_SOURCE}/${V8_DESTINATION}
LOGNAME build-${TARGET_TRIPLET})
endif()
foreach(PATCH ${V8_PATCHES})
vcpkg_execute_required_process(
COMMAND ${GIT} apply ${PATCH}
WORKING_DIRECTORY ${V8_SOURCE}/${V8_DESTINATION}
LOGNAME build-${TARGET_TRIPLET})
endforeach()
endfunction()
vcpkg_from_git(
OUT_SOURCE_PATH SOURCE_PATH
URL https://chromium.googlesource.com/v8/v8.git
REF 7d3d62c91f69a702e5aa54c6b4dbbaa883683717
PATCHES ${CURRENT_PORT_DIR}/v8.patch
)
message(STATUS "Fetching submodules")
v8_fetch(
DESTINATION build
URL https://chromium.googlesource.com/chromium/src/build.git
REF fd86d60f33cbc794537c4da2ef7e298d7f81138e
SOURCE ${SOURCE_PATH}
PATCHES ${CURRENT_PORT_DIR}/build.patch)
v8_fetch(
DESTINATION third_party/zlib
URL https://chromium.googlesource.com/chromium/src/third_party/zlib.git
REF 156be8c52f80cde343088b4a69a80579101b6e67
SOURCE ${SOURCE_PATH})
v8_fetch(
DESTINATION base/trace_event/common
URL https://chromium.googlesource.com/chromium/src/base/trace_event/common.git
REF dab187b372fc17e51f5b9fad8201813d0aed5129
SOURCE ${SOURCE_PATH})
v8_fetch(
DESTINATION third_party/googletest/src
URL https://chromium.googlesource.com/external/github.com/google/googletest.git
REF 10b1902d893ea8cc43c69541d70868f91af3646b
SOURCE ${SOURCE_PATH})
v8_fetch(
DESTINATION third_party/jinja2
URL https://chromium.googlesource.com/chromium/src/third_party/jinja2.git
REF b41863e42637544c2941b574c7877d3e1f663e25
SOURCE ${SOURCE_PATH})
v8_fetch(
DESTINATION third_party/markupsafe
URL https://chromium.googlesource.com/chromium/src/third_party/markupsafe.git
REF 8f45f5cfa0009d2a70589bcda0349b8cb2b72783
SOURCE ${SOURCE_PATH})
vcpkg_execute_required_process(
COMMAND ${PYTHON2} build/util/lastchange.py -o build/util/LASTCHANGE
WORKING_DIRECTORY ${SOURCE_PATH}
LOGNAME build-${TARGET_TRIPLET}
)
file(MAKE_DIRECTORY "${SOURCE_PATH}/third_party/icu")
configure_file("${CURRENT_PORT_DIR}/zlib.gn" "${SOURCE_PATH}/third_party/zlib/BUILD.gn" COPYONLY)
configure_file("${CURRENT_PORT_DIR}/icu.gn" "${SOURCE_PATH}/third_party/icu/BUILD.gn" COPYONLY)
file(WRITE "${SOURCE_PATH}/build/config/gclient_args.gni" "checkout_google_benchmark = false\n")
if(WIN32)
string(REGEX REPLACE "\\\\+$" "" WindowsSdkDir $ENV{WindowsSdkDir})
file(APPEND "${SOURCE_PATH}/build/config/gclient_args.gni" "windows_sdk_path = \"${WindowsSdkDir}\"\n")
endif()
if(UNIX)
set(UNIX_CURRENT_INSTALLED_DIR ${CURRENT_INSTALLED_DIR})
set(LIBS "-ldl -lpthread")
set(REQUIRES ", gmodule-2.0, gobject-2.0, gthread-2.0")
elseif(WIN32)
execute_process(COMMAND cygpath "${CURRENT_INSTALLED_DIR}" OUTPUT_VARIABLE UNIX_CURRENT_INSTALLED_DIR)
string(STRIP ${UNIX_CURRENT_INSTALLED_DIR} UNIX_CURRENT_INSTALLED_DIR)
set(LIBS "-lWinmm -lDbgHelp")
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(is_component_build true)
set(v8_monolithic false)
set(v8_use_external_startup_data true)
set(targets :v8_libbase :v8_libplatform :v8)
else()
set(is_component_build false)
set(v8_monolithic true)
set(v8_use_external_startup_data false)
set(targets :v8_monolith)
endif()
message(STATUS "Generating v8 build files. Please wait...")
vcpkg_configure_gn(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS "is_component_build=${is_component_build} target_cpu=\"${VCPKG_TARGET_ARCHITECTURE}\" v8_monolithic=${v8_monolithic} v8_use_external_startup_data=${v8_use_external_startup_data} use_sysroot=false is_clang=false use_custom_libcxx=false v8_enable_verify_heap=false icu_use_data_file=false"
OPTIONS_DEBUG "is_debug=true enable_iterator_debugging=true pkg_config_libdir=\"${UNIX_CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig\""
OPTIONS_RELEASE "is_debug=false enable_iterator_debugging=false pkg_config_libdir=\"${UNIX_CURRENT_INSTALLED_DIR}/lib/pkgconfig\""
)
message(STATUS "Building v8. Please wait...")
vcpkg_install_gn(
SOURCE_PATH "${SOURCE_PATH}"
TARGETS ${targets}
)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(CFLAGS "-DV8_COMPRESS_POINTERS -DV8_31BIT_SMIS_ON_64BIT_ARCH")
endif()
file(INSTALL "${SOURCE_PATH}/include" DESTINATION "${CURRENT_PACKAGES_DIR}/include" FILES_MATCHING PATTERN "*.h")
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(PREFIX ${CURRENT_PACKAGES_DIR})
configure_file("${CURRENT_PORT_DIR}/v8.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/v8.pc" @ONLY)
configure_file("${CURRENT_PORT_DIR}/v8_libbase.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/v8_libbase.pc" @ONLY)
configure_file("${CURRENT_PORT_DIR}/v8_libplatform.pc.in" "{CURRENT_PACKAGES_DIR}/lib/pkgconfig/v8_libplatform.pc" @ONLY)
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/snapshot_blob.bin" DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
set(PREFIX ${CURRENT_PACKAGES_DIR}/debug)
configure_file("${CURRENT_PORT_DIR}/v8.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/v8.pc" @ONLY)
configure_file("${CURRENT_PORT_DIR}/v8_libbase.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/v8_libbase.pc" @ONLY)
configure_file("${CURRENT_PORT_DIR}/v8_libplatform.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/v8_libplatform.pc" @ONLY)
configure_file("${CURRENT_PORT_DIR}/V8Config-shared.cmake" "${CURRENT_PACKAGES_DIR}/share/v8/V8Config.cmake" @ONLY)
file(INSTALL "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/snapshot_blob.bin" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
else()
set(PREFIX ${CURRENT_PACKAGES_DIR})
configure_file("${CURRENT_PORT_DIR}/v8_monolith.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/v8_monolith.pc" @ONLY)
set(PREFIX ${CURRENT_PACKAGES_DIR}/debug)
configure_file("${CURRENT_PORT_DIR}/v8_monolith.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/v8_monolith.pc" @ONLY)
configure_file("${CURRENT_PORT_DIR}/V8Config-static.cmake" "${CURRENT_PACKAGES_DIR}/share/v8/V8Config.cmake" @ONLY)
endif()
vcpkg_copy_pdbs()
# v8 libraries are listed as SYSTEM_LIBRARIES because the pc files reference each other.
vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m dl pthread Winmm DbgHelp v8_libbase v8_libplatform v8)
# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View file

@ -1,241 +0,0 @@
diff --git a/BUILD.gn b/BUILD.gn
index d2bfb6129d..c5ab18ee44 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -5366,6 +5366,7 @@ if (is_component_build) {
public_deps = [
":v8_base",
+ ":v8_initializers",
":v8_snapshot",
]
diff --git a/src/codegen/code-stub-assembler.h b/src/codegen/code-stub-assembler.h
index 72b8fbc8a8..3ebfc23f1f 100644
--- a/src/codegen/code-stub-assembler.h
+++ b/src/codegen/code-stub-assembler.h
@@ -303,7 +303,7 @@ enum class PrimitiveType { kBoolean, kNumber, kString, kSymbol };
// it's possible to add JavaScript-specific useful CodeAssembler "macros"
// without modifying files in the compiler directory (and requiring a review
// from a compiler directory OWNER).
-class V8_EXPORT_PRIVATE CodeStubAssembler
+class V8_EXPORT CodeStubAssembler
: public compiler::CodeAssembler,
public TorqueGeneratedExportedMacrosAssembler {
public:
diff --git a/src/common/globals.h b/src/common/globals.h
index f51c3210f8..5291285337 100644
--- a/src/common/globals.h
+++ b/src/common/globals.h
@@ -1364,7 +1364,7 @@ class BinaryOperationFeedback {
// This is distinct from BinaryOperationFeedback on purpose, because the
// feedback that matters differs greatly as well as the way it is consumed.
class CompareOperationFeedback {
- enum {
+ enum : uint32_t {
kSignedSmallFlag = 1 << 0,
kOtherNumberFlag = 1 << 1,
kBooleanFlag = 1 << 2,
@@ -1378,7 +1378,7 @@ class CompareOperationFeedback {
};
public:
- enum Type {
+ enum Type : uint32_t {
kNone = 0,
kBoolean = kBooleanFlag,
diff --git a/src/compiler/node-cache.h b/src/compiler/node-cache.h
index 8e1d3d4eae..c55d8329de 100644
--- a/src/compiler/node-cache.h
+++ b/src/compiler/node-cache.h
@@ -29,7 +29,7 @@ class Node;
// nodes such as constants, parameters, etc.
template <typename Key, typename Hash = base::hash<Key>,
typename Pred = std::equal_to<Key> >
-class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) NodeCache final {
+class V8_EXPORT_PRIVATE NodeCache final {
public:
explicit NodeCache(Zone* zone) : map_(zone) {}
~NodeCache() = default;
diff --git a/src/heap/paged-spaces-inl.h b/src/heap/paged-spaces-inl.h
index e135e30efc..0c055247bc 100644
--- a/src/heap/paged-spaces-inl.h
+++ b/src/heap/paged-spaces-inl.h
@@ -19,7 +19,7 @@ namespace internal {
// -----------------------------------------------------------------------------
// PagedSpaceObjectIterator
-HeapObject PagedSpaceObjectIterator::Next() {
+inline HeapObject PagedSpaceObjectIterator::Next() {
do {
HeapObject next_obj = FromCurrentPage();
if (!next_obj.is_null()) return next_obj;
diff --git a/src/heap/paged-spaces.h b/src/heap/paged-spaces.h
index 621d92aa89..a8592a5b4d 100644
--- a/src/heap/paged-spaces.h
+++ b/src/heap/paged-spaces.h
@@ -45,7 +45,7 @@ class V8_EXPORT_PRIVATE PagedSpaceObjectIterator : public ObjectIterator {
// Advance to the next object, skipping free spaces and other fillers and
// skipping the special garbage section of which there is one per space.
// Returns nullptr when the iteration has ended.
- inline HeapObject Next() override;
+ HeapObject Next() override;
private:
// Fast (inlined) path of next().
diff --git a/src/objects/feedback-vector.cc b/src/objects/feedback-vector.cc
index a77ea5d265..0cddb92a02 100644
--- a/src/objects/feedback-vector.cc
+++ b/src/objects/feedback-vector.cc
@@ -114,9 +114,9 @@ Handle<FeedbackMetadata> FeedbackMetadata::New(LocalIsolate* isolate,
return metadata;
}
-template Handle<FeedbackMetadata> FeedbackMetadata::New(
+template V8_EXPORT Handle<FeedbackMetadata> FeedbackMetadata::New(
Isolate* isolate, const FeedbackVectorSpec* spec);
-template Handle<FeedbackMetadata> FeedbackMetadata::New(
+template V8_EXPORT Handle<FeedbackMetadata> FeedbackMetadata::New(
LocalIsolate* isolate, const FeedbackVectorSpec* spec);
bool FeedbackMetadata::SpecDiffersFrom(
diff --git a/src/objects/fixed-array-inl.h b/src/objects/fixed-array-inl.h
index cca6d40070..d6d36ff59f 100644
--- a/src/objects/fixed-array-inl.h
+++ b/src/objects/fixed-array-inl.h
@@ -88,7 +88,7 @@ bool FixedArray::is_the_hole(Isolate* isolate, int index) {
return get(isolate, index).IsTheHole(isolate);
}
-void FixedArray::set(int index, Smi value) {
+inline V8_EXPORT_PRIVATE void FixedArray::set(int index, Smi value) {
DCHECK_NE(map(), GetReadOnlyRoots().fixed_cow_array_map());
DCHECK_LT(static_cast<unsigned>(index), static_cast<unsigned>(length()));
DCHECK(Object(value).IsSmi());
diff --git a/src/objects/fixed-array.h b/src/objects/fixed-array.h
index 98c5d8d5b5..bd5303e44c 100644
--- a/src/objects/fixed-array.h
+++ b/src/objects/fixed-array.h
@@ -132,7 +132,7 @@ class FixedArray
inline bool is_the_hole(Isolate* isolate, int index);
// Setter that doesn't need write barrier.
- inline void set(int index, Smi value);
+ inline V8_EXPORT_PRIVATE void set(int index, Smi value);
// Setter with explicit barrier mode.
inline void set(int index, Object value, WriteBarrierMode mode);
diff --git a/src/snapshot/snapshot-utils.cc b/src/snapshot/snapshot-utils.cc
index eb2372372c..7defadb4b1 100644
--- a/src/snapshot/snapshot-utils.cc
+++ b/src/snapshot/snapshot-utils.cc
@@ -5,7 +5,7 @@
#include "src/snapshot/snapshot-utils.h"
#include "src/sanitizer/msan.h"
-#include "third_party/zlib/zlib.h"
+#include "zlib.h"
namespace v8 {
namespace internal {
diff --git a/src/wasm/function-body-decoder-impl.h b/src/wasm/function-body-decoder-impl.h
index d37f718681..3a409e1d76 100644
--- a/src/wasm/function-body-decoder-impl.h
+++ b/src/wasm/function-body-decoder-impl.h
@@ -2013,7 +2013,7 @@ class WasmDecoder : public Decoder {
}
// TODO(clemensb): This is only used by the interpreter; move there.
- V8_EXPORT_PRIVATE std::pair<uint32_t, uint32_t> StackEffect(const byte* pc) {
+ std::pair<uint32_t, uint32_t> StackEffect(const byte* pc) {
WasmOpcode opcode = static_cast<WasmOpcode>(*pc);
// Handle "simple" opcodes with a fixed signature first.
const FunctionSig* sig = WasmOpcodes::Signature(opcode);
diff --git a/test/cctest/BUILD.gn b/test/cctest/BUILD.gn
index ffa4e3a136..a279faee9b 100644
--- a/test/cctest/BUILD.gn
+++ b/test/cctest/BUILD.gn
@@ -493,6 +493,10 @@ v8_source_set("cctest_sources") {
# C4309: 'static_cast': truncation of constant value
cflags += [ "/wd4309" ]
+ if(!is_clang) {
+ cflags += [ "/wd4789" ]
+ }
+
# MSVS wants this for gay-{precision,shortest}.cc.
cflags += [ "/bigobj" ]
diff --git a/tools/debug_helper/BUILD.gn b/tools/debug_helper/BUILD.gn
index 2256df1f55..29e27c6af9 100644
--- a/tools/debug_helper/BUILD.gn
+++ b/tools/debug_helper/BUILD.gn
@@ -100,10 +100,12 @@ v8_component("v8_debug_helper") {
"../..:v8_libbase",
"../..:v8_shared_internal_headers",
"../..:v8_tracing",
+ "../..:v8",
]
configs = [ ":internal_config" ]
if (v8_enable_i18n_support) {
+ public_deps = [ "//third_party/icu" ]
configs += [ "//third_party/icu:icu_config" ]
}
diff --git a/tools/v8windbg/BUILD.gn b/tools/v8windbg/BUILD.gn
index 5618d2d945..71568f1670 100644
--- a/tools/v8windbg/BUILD.gn
+++ b/tools/v8windbg/BUILD.gn
@@ -6,7 +6,7 @@ import("../../gni/v8.gni")
config("v8windbg_config") {
# Required for successful compilation of SDK header file DbgModel.h.
- cflags_cc = [ "/Zc:twoPhase-" ]
+ cflags_cc = [ "/Zc:twoPhase-", "/std:c++latest" ]
include_dirs = [ "../.." ]
}
diff --git a/tools/v8windbg/base/dbgext.h b/tools/v8windbg/base/dbgext.h
index 8b36a8f361..f8d9f0d64e 100644
--- a/tools/v8windbg/base/dbgext.h
+++ b/tools/v8windbg/base/dbgext.h
@@ -9,6 +9,7 @@
#error Unicode not defined
#endif
+#include <new>
#include <DbgEng.h>
#include <DbgModel.h>
#include <Windows.h>
diff --git a/tools/v8windbg/src/v8-debug-helper-interop.h b/tools/v8windbg/src/v8-debug-helper-interop.h
index f7d78c5dd3..1c70e54e7a 100644
--- a/tools/v8windbg/src/v8-debug-helper-interop.h
+++ b/tools/v8windbg/src/v8-debug-helper-interop.h
@@ -5,10 +5,11 @@
#ifndef V8_TOOLS_V8WINDBG_SRC_V8_DEBUG_HELPER_INTEROP_H_
#define V8_TOOLS_V8WINDBG_SRC_V8_DEBUG_HELPER_INTEROP_H_
-#include <wrl/client.h>
-
+#include <new>
+#include <DbgEng.h>
#include <DbgModel.h>
+#include <wrl/client.h>
#include <cstdint>
#include <map>
#include <string>
diff --git a/tools/v8windbg/test/debug-callbacks.h b/tools/v8windbg/test/debug-callbacks.h
index 8855d6ffbc..ed2b0f62e9 100644
--- a/tools/v8windbg/test/debug-callbacks.h
+++ b/tools/v8windbg/test/debug-callbacks.h
@@ -9,6 +9,7 @@
#error Unicode not defined
#endif
+#include <new>
#include <DbgEng.h>
#include <DbgModel.h>
#include <Windows.h>

View file

@ -1,11 +0,0 @@
prefix=@PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: v8
Description: V8 JavaScript Engine
Version: @pkgver@
Requires: zlib, icu-uc, icu-i18n, v8_libbase = @pkgver@
Libs: -L${libdir} -lv8
Cflags: -I${includedir} @CFLAGS@

View file

@ -1,10 +0,0 @@
prefix=@PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: v8
Description: V8 JavaScript Engine - Base library
Version: @pkgver@
Libs: -L${libdir} -lv8_libbase
Cflags: -I${includedir} @CFLAGS@

View file

@ -1,10 +0,0 @@
prefix=@PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: v8
Description: V8 JavaScript Engine - Platform library
Version: @pkgver@
Libs: -L${libdir} -lv8_libplatform
Cflags: -I${includedir} @CFLAGS@

View file

@ -1,11 +0,0 @@
prefix=@PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: v8
Description: V8 JavaScript Engine
Version: @pkgver@
Requires: zlib, icu-uc, icu-i18n @REQUIRES@
Libs: -L${libdir} -lv8_monolith @LIBS@
Cflags: -I${includedir} @CFLAGS@

View file

@ -1,25 +0,0 @@
{
"name": "v8",
"version": "9.1.269.39",
"port-version": 4,
"description": "Google Chrome's JavaScript engine",
"homepage": "https://v8.dev",
"license": "BSD-3-Clause",
"supports": "!(arm | arm64 | uwp | osx | linux)",
"dependencies": [
{
"name": "glib",
"platform": "linux"
},
"icu",
{
"name": "pthread",
"platform": "linux"
},
{
"name": "vcpkg-tool-python2",
"host": true
},
"zlib"
]
}

View file

@ -1,21 +0,0 @@
import("//build/config/linux/pkg_config.gni")
pkg_config("system_zlib") {
packages = [ "zlib" ]
defines = [ "USE_SYSTEM_ZLIB=1" ]
}
config("zlib_config") {
if(is_win && !is_component_build) {
ldflags = ["/ignore:4099"] # needed on VCPKG CI builds
}
configs = [
":system_zlib",
]
}
source_set("zlib") {
public_configs = [
":system_zlib",
]
}

View file

@ -0,0 +1,59 @@
# Copyright 2023 Overte e.V.
# SPDX-License-Identifier: MIT
# Docker file for building Overte Node packages for Ubuntu 18.04
# Some steps for actually using this:
# - Check which commit you are building https://invent.kde.org/qt/qt/qt5/-/tree/kde/5.15
# - Adjust this file to include the number of threads you want to use (-j10), and the Node version.
# Keep in mind that building Qt requires a lot of memory. You should have over 1.2GiB of system memory available per thread.
# - Run the build process with something like `PROGRESS_NO_TRUNC=1 DOCKER_BUILDKIT=1 BUILDKIT_STEP_LOG_MAX_SIZE=-1 docker build --progress plain -t overte-node:node-18.14.2 -f Dockerfile_Ubuntu_18.04_node .`
# Buildkit is used to cache intermittent steps in case you need to modify something afterwards.
# - Once the build has completed, create a container from the image and export the created Node package.
# `docker create --name extract overte-node:node-18.14.2`
# `docker cp extract:node-install-18.14.2-ubuntu-18.04-amd64-release.tar.xz /path/on/host`
# `docker rm extract`
FROM ubuntu:18.04
LABEL maintainer="Julian Groß (julian.gro@overte.org)"
LABEL description="Development image for Overte Node packages for Ubuntu 18.04."
# Don't use any frontend when installalling packages during the creation of this container
ARG DEBIAN_FRONTEND=noninteractive
RUN echo UTC >/etc/timezone
# Enable source repositories for apt
RUN sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
# Update package list
RUN apt-get update
# Upgrade packages
RUN apt-get -y upgrade
RUN apt-get -y install git
# Clone and enter single branch of Node
RUN git clone --recursive https://github.com/nodejs/node.git -b v18.14.2 --single-branch
# Install node system build dependencies
RUN apt-get -y build-dep nodejs
# Install build dependencies
#RUN apt-get -y install python gperf flex bison pkg-config mesa-utils libgl1-mesa-dev make g++ libdbus-glib-1-dev libnss3-dev nodejs libxkbfile-dev libx11-dev
RUN mkdir node-install
WORKDIR node
#RUN ./configure --gdb --shared --prefix=../node-install/
RUN ./configure --gdb --shared --debug --debug-lib --v8-with-dchecks --v8-enable-object-print --prefix=../node-install/
RUN make -j10
RUN make -j10 install
RUN cp config.status ../node-install/
WORKDIR ..
RUN XZ_OPT='-T0' tar -Jcvf node-install-18.14.2-ubuntu-18.04-amd64-release.tar.xz node-install

View file

@ -0,0 +1,113 @@
# Copyright 2023 Overte e.V.
# SPDX-License-Identifier: MIT
# General
This document describes the process to build Node 18.14.2 for usage as scripting engine..
Reference: https://github.com/nodejs/node/blob/main/BUILDING.md
## Requirements
### Windows
TODO
### Linux
1. git
### Mac
TODO
## Build Process
### General
The build is performed in source.
Build products are installed to the node-install folder.
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.
#### Preparing source files
Get the source:
`git clone --recursive https://github.com/nodejs/node.git -b v18.14.2 --single-branch`
#### Configuring
TODO
#### Make
TODO
#### Uploading
Create an 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.
* `7z a -ttar qnode-install-18.14.2-windows-release.tar node-install`
* `7z a -txz node-install-18.14.2-windows-release.tar.xz node-install-18.14.2-windows-release.tar`
Upload node-install-18.14.2-windows.tar.xz to build-deps.overte.org, under the dependencies/node directory.
### Linux
#### Preparing source files
```bash
git clone --recursive https://github.com/nodejs/node.git -b v18.14.2 --single-branch
```
#### Configuring
```bash
mkdir node-install
```
release:
```bash
cd node
./configure --gdb --shared --prefix=../node-install/
```
debug:
```bash
cd node
./configure --gdb --shared --debug --debug-lib --v8-with-dchecks --v8-enable-object-print --prefix=../node-install/
```
#### Make
Replace `4` with the amount of threads you want to use. Keep in mind that the Node build process uses a lot of memory. It is recommended to have at least 1.2 GiB per thread.
```bash
make -j4
```
Now Node can be installed to node-install:
```bash
make -j4 install
```
#### Uploading
1. Tar and xz qt5-install to create the package. Replace `ubuntu-18.04` with the relevant system and `amd64` with the relevant architecture.
```bash
tar -Jcvf node-install-18.14.2-ubuntu-18.04-amd64-release.tar.xz node-install
```
2. Upload node-install-18.14.2-ubuntu-18.04-amd64-release.tar.xz to https://build-deps.overte.org/dependencies/node/
### Mac
#### Preparing source files
```bash
git clone --recursive https://github.com/nodejs/node.git -b v18.14.2 --single-branch
```
#### Configuring
TODO
#### Make
TODO
#### Uploading
```bash
tar -Jcvf node-install-18.14.2-macOSXSDK10.14-macos-release.tar.xz node-install
```
Upload node-install-18.14.2-macOSXSDK10.14-macos-release.tar.xz to build-deps.overte.org, under the dependencies/node directory.