diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a3030112d6..180ac283ed9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ set(CMAKE_OSX_SYSROOT ${HERMES_APPLE_TARGET_PLATFORM}) if(HERMES_APPLE_TARGET_PLATFORM MATCHES "catalyst") set(CMAKE_OSX_SYSROOT "macosx") - set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-target x86_64-arm64-apple-ios14.0-macabi -isystem ${CMAKE_OSX_SYSROOT}/System/iOSSupport/usr/include") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -target x86_64-arm64-apple-ios14.0-macabi -isystem ${CMAKE_OSX_SYSROOT}/System/iOSSupport/usr/include") set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-target x86_64-arm64-apple-ios14.0-macabi -isystem ${CMAKE_OSX_SYSROOT}/System/iOSSupport/usr/include") set(CMAKE_THREAD_LIBS_INIT "-lpthread") set(CMAKE_HAVE_THREADS_LIBRARY 1) @@ -279,9 +279,6 @@ set(HERMES_ENABLE_TEST_SUITE ON CACHE BOOL set(HERMES_BUILD_APPLE_FRAMEWORK OFF CACHE BOOL "Whether to build the libhermes target as a framework bundle or dylib on Apple platforms") -set(HERMES_BUILD_APPLE_DSYM OFF CACHE BOOL - "Whether to build a DWARF debugging symbols bundle") - set(HERMES_BUILD_NODE_HERMES OFF CACHE BOOL "Whether to build node-hermes") set(HERMES_BUILD_LEAN_LIBHERMES OFF CACHE BOOL "Exclude the Hermes compiler from libhermes.") @@ -321,10 +318,6 @@ if(HERMES_CHECK_NATIVE_STACK) add_definitions(-DHERMES_CHECK_NATIVE_STACK) endif() -if(HERMES_BUILD_APPLE_DSYM) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gdwarf") -endif() - if (HERMES_IS_MOBILE_BUILD) add_definitions(-DHERMES_IS_MOBILE_BUILD) endif() diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index c4e4613e98d..588197b6cb4 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -205,35 +205,6 @@ if(APPLE AND HERMES_BUILD_APPLE_FRAMEWORK) endif() endif() -# Create debug symbols (dSYM) bundle for Apple platform dylibs/frameworks -# Largely inspired by https://github.com/llvm/llvm-project/blob/6701993027f8af172d7ba697884459261b00e3c6/llvm/cmake/modules/AddLLVM.cmake#L1934-L1986 -if(HERMES_BUILD_APPLE_DSYM) - if(CMAKE_CXX_FLAGS MATCHES "-flto") - set(lto_object ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/hermesvm-lto.o) - set_property(TARGET hermesvm APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-object_path_lto,${lto_object}") - endif() - - get_target_property(DSYM_PATH hermesvm LOCATION) - if(HERMES_BUILD_APPLE_FRAMEWORK) - get_filename_component(DSYM_PATH ${DSYM_PATH} DIRECTORY) - endif() - set(DSYM_PATH "${DSYM_PATH}.dSYM") - - if(NOT CMAKE_DSYMUTIL) - set(CMAKE_DSYMUTIL xcrun dsymutil) - endif() - add_custom_command(TARGET hermesvm POST_BUILD - COMMAND ${CMAKE_DSYMUTIL} $ --out ${DSYM_PATH} - BYPRODUCTS ${DSYM_PATH} - ) - - if(HERMES_BUILD_APPLE_FRAMEWORK) - install(DIRECTORY ${DSYM_PATH} DESTINATION Library/Frameworks/${HERMES_APPLE_TARGET_PLATFORM}) - else() - install(DIRECTORY ${DSYM_PATH} DESTINATION lib) - endif() -endif() - # Force the entire hermesvm_a library to be used by hermesvm. There is # no cross platform way to do this (force_load is for macOS). Once we upgrade # CMake 3.24, we can use the LINK_LIBRARY generator expression to do this. diff --git a/utils/build-apple-framework.sh b/utils/build-apple-framework.sh index ca09745e72b..300ea53616f 100755 --- a/utils/build-apple-framework.sh +++ b/utils/build-apple-framework.sh @@ -71,7 +71,7 @@ function configure_apple_framework { -DHERMES_ENABLE_FUZZILLI:BOOLEAN=false \ -DHERMES_ENABLE_TEST_SUITE:BOOLEAN=false \ -DHERMES_BUILD_APPLE_FRAMEWORK:BOOLEAN=true \ - -DHERMES_BUILD_APPLE_DSYM:BOOLEAN=true \ + -DCMAKE_CXX_FLAGS="-gdwarf ${CMAKE_CXX_FLAGS}" \ -DHERMES_ENABLE_TOOLS:BOOLEAN="$build_cli_tools" \ -DIMPORT_HERMESC:PATH="$PWD/build_host_hermesc/ImportHermesc.cmake" \ -DCMAKE_INSTALL_PREFIX:PATH=../destroot \