Skip to content

Commit

Permalink
Review v2
Browse files Browse the repository at this point in the history
  • Loading branch information
piaskowyk committed Dec 11, 2024
1 parent c384c05 commit 5e41c57
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 31 deletions.
3 changes: 0 additions & 3 deletions API/jsi/jsi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
# when they go out of scope due to exceptions.
list(APPEND jsi_compile_flags "/EHsc")
endif()
if (HERMES_ENABLE_BITCODE)
list(APPEND jsi_compile_flags "-fembed-bitcode")
endif ()
target_compile_options(jsi PRIVATE ${jsi_compile_flags})

install(DIRECTORY "${PROJECT_SOURCE_DIR}/API/jsi/" DESTINATION include
Expand Down
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,6 @@ set(HERMES_ENABLE_FUZZILLI OFF CACHE BOOL
set(HERMES_ENABLE_TOOLS ON CACHE BOOL
"Enable CLI tools")

# Enable bitcode
set(HERMES_ENABLE_BITCODE OFF CACHE BOOL
"Include bitcode with the framework")

# Set linker flag for building the fuzzer
set(HERMES_FUZZING_FLAG "-fsanitize=fuzzer" CACHE STRING
"Linker argument to link fuzz targets against a given fuzzer.")
Expand Down Expand Up @@ -557,6 +553,11 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
if (HERMES_MSVC_MP)
add_definitions( /MP )
endif()

# MSVC does not have strict aliasing so there is no need to support it.
# Similar to GCC/Clang above, disable strict signed integer overflow.
# TODO: Investigate disabling strict signed integer overflow for MSVC
# append("/d2UndefIntOverflow-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
endif()

# Export a JSON file with the compilation commands that external tools can use
Expand Down
6 changes: 0 additions & 6 deletions cmake/modules/Hermes.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ function(add_hermes_library name)
target_link_libraries(${name} ${ARG_LINK_OBJLIBS} ${ARG_LINK_LIBS})
set_property(TARGET ${name} PROPERTY POSITION_INDEPENDENT_CODE ON)
hermes_update_compile_flags(${name})
if (HERMES_ENABLE_BITCODE)
target_compile_options(${name} PUBLIC "-fembed-bitcode")
endif ()
else()
# When asking to link an OBJECT library (the default), we create an OBJECT
# library with a suffix _obj, which depends on all object libraries in
Expand All @@ -151,9 +148,6 @@ function(add_hermes_library name)
target_link_libraries(${name}_obj ${ARG_LINK_LIBS})
set_property(TARGET ${name}_obj PROPERTY POSITION_INDEPENDENT_CODE ON)
hermes_update_compile_flags(${name}_obj)
if (HERMES_ENABLE_BITCODE)
target_compile_options(${name}_obj PUBLIC "-fembed-bitcode")
endif ()

add_library(${name} STATIC)
target_link_libraries(${name} ${name}_obj ${ARG_LINK_OBJLIBS})
Expand Down
11 changes: 0 additions & 11 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,6 @@ if(APPLE AND HERMES_BUILD_APPLE_FRAMEWORK)
MACOSX_FRAMEWORK_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_FRAMEWORK_IDENTIFIER dev.hermesengine.${HERMES_APPLE_TARGET_PLATFORM}
)
# Install headers into `Headers` while keeping required directory structure
set_source_files_properties(${api_headers} PROPERTIES
MACOSX_PACKAGE_LOCATION Headers
)
set_source_files_properties(${api_public_headers} PROPERTIES
MACOSX_PACKAGE_LOCATION Headers/Public
)
if(HERMES_ENABLE_BITCODE)
target_compile_options(hermesvm PUBLIC "-fembed-bitcode")
target_link_options(hermesvm PUBLIC "-fembed-bitcode")
endif()
# Define the deployment target in the frameworks metadata
if(HERMES_APPLE_TARGET_PLATFORM MATCHES "iphone")
add_custom_command(TARGET hermesvm POST_BUILD
Expand Down
8 changes: 1 addition & 7 deletions utils/build-apple-framework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,8 @@ function build_host_hermesc {

# Utility function to configure an Apple framework
function configure_apple_framework {
local build_cli_tools enable_bitcode
local build_cli_tools

if [[ $1 == appletvos || $1 == iphoneos || $1 == catalyst || $1 == visionos ]]; then
enable_bitcode="true"
else
enable_bitcode="false"
fi
if [[ $1 == macosx ]]; then
build_cli_tools="true"
else
Expand All @@ -75,7 +70,6 @@ function configure_apple_framework {
-DHERMES_ENABLE_LIBFUZZER:BOOLEAN=false \
-DHERMES_ENABLE_FUZZILLI:BOOLEAN=false \
-DHERMES_ENABLE_TEST_SUITE:BOOLEAN=false \
-DHERMES_ENABLE_BITCODE:BOOLEAN="$enable_bitcode" \
-DHERMES_BUILD_APPLE_FRAMEWORK:BOOLEAN=true \
-DHERMES_BUILD_APPLE_DSYM:BOOLEAN=true \
-DHERMES_ENABLE_TOOLS:BOOLEAN="$build_cli_tools" \
Expand Down

0 comments on commit 5e41c57

Please sign in to comment.