Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion API/hermes_node_api/node_api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@
Files in this folder are the Node-API from Node.js project.
https://github.com/nodejs/node-api-headers/tree/main/include

See the copy of the license file in this folder.
They are augmented with the experiemental APIs from the Node.js project
https://github.com/nodejs/node

See the copy of the license file in this folder.

# Additional files

The js_runtime_api.h file is part of this project and
licensed under Microsoft MIT license.
13 changes: 10 additions & 3 deletions cmake/modules/Hermes.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ function(hermes_update_compile_flags name)
set_property(TARGET ${name} APPEND_STRING PROPERTY
COMPILE_FLAGS "${flags}")
endif ()

if (MSVC)
# Temporary avoid the auto-vectorization optimization since VS 17.14.0 produces incorrect code.
# Set /O1 only for Release configs using modern CMake target_compile_options.
target_compile_options(${name} PRIVATE $<$<CONFIG:Release>:/O1>)
endif ()
endfunction()

function(add_hermes_library name)
Expand Down Expand Up @@ -258,13 +264,14 @@ if (MSVC)

if (NOT CLANG_CL)
set(msvc_warning_flags
# SDL requires these 3 checks enabled: 4146, 4244, 4267
# Disabled warnings.
-wd4141 # Suppress ''modifier' : used more than once' (because of __forceinline combined with inline)
-wd4146 # Suppress 'unary minus operator applied to unsigned type, result still unsigned'
# -wd4146 # Suppress 'unary minus operator applied to unsigned type, result still unsigned'
-wd4180 # Suppress 'qualifier applied to function type has no meaning; ignored'
-wd4244 # Suppress ''argument' : conversion from 'type1' to 'type2', possible loss of data'
# -wd4244 # Suppress ''argument' : conversion from 'type1' to 'type2', possible loss of data'
-wd4258 # Suppress ''var' : definition from the for loop is ignored; the definition from the enclosing scope is used'
-wd4267 # Suppress ''var' : conversion from 'size_t' to 'type', possible loss of data'
# -wd4267 # Suppress ''var' : conversion from 'size_t' to 'type', possible loss of data'
-wd4291 # Suppress ''declaration' : no matching operator delete found; memory will not be freed if initialization throws an exception'
-wd4345 # Suppress 'behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized'
-wd4351 # Suppress 'new behavior: elements of array 'array' will be default initialized'
Expand Down
6 changes: 1 addition & 5 deletions cmake/modules/HermesWindows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,7 @@ function(hermes_windows_configure_msvc_flags)
# C4146: Re-enable 'unary minus operator applied to unsigned type, result still unsigned'
# Downgrade from error to warning level 3 (promoted to error by /sdl)
set(MSVC_CXX_FLAGS "${MSVC_CXX_FLAGS} /w34146")
# C4244: Re-enable 'conversion from type1 to type2, possible loss of data'
set(MSVC_CXX_FLAGS "${MSVC_CXX_FLAGS} /w44244")
# C4267: Re-enable 'conversion from size_t to type, possible loss of data'
set(MSVC_CXX_FLAGS "${MSVC_CXX_FLAGS} /w44267")


# Windows-specific warning suppressions for DLL builds

# C4251: class X needs to have dll-interface to be used by clients of class Y
Expand Down