Skip to content

Commit

Permalink
Move EH/RTTI manipulation into API/hermes
Browse files Browse the repository at this point in the history
Summary:
Instead of enabling EH and RTTI for everything in the API directory,
and then having to turn it off, just leave it off by default.

Reviewed By: fbmal7

Differential Revision: D47447536

fbshipit-source-id: aa39ab91dbe2a13cbb047c987aedd52759a57b81
  • Loading branch information
neildhar authored and facebook-github-bot committed Aug 1, 2023
1 parent a183b15 commit 16c07b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
3 changes: 0 additions & 3 deletions API/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

set(HERMES_ENABLE_EH ON)
set(HERMES_ENABLE_RTTI ON)

add_subdirectory(hermes)
27 changes: 12 additions & 15 deletions API/hermes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# compileJS uses neither exceptions nor RTTI
add_hermes_library(compileJS CompileJS.cpp LINK_LIBS hermesPublic)

set(HERMES_ENABLE_EH ON)

# synthTraceParser uses exceptions but not RTTI.
# TODO(T127739425): Switch it to either use both exceptions and RTTI or neither.
add_hermes_library(synthTraceParser SynthTraceParser.cpp LINK_LIBS hermesSupport hermesParser synthTrace)

# All remaining targets in this file use both exceptions and RTTI.
set(HERMES_ENABLE_RTTI ON)

set(api_sources
hermes.cpp
DebuggerAPI.cpp
Expand Down Expand Up @@ -30,21 +42,6 @@ add_hermes_library(traceInterpreter TraceInterpreter.cpp
LINK_LIBS hermesapi hermesInstrumentation synthTrace synthTraceParser)

set(HERMES_LINK_COMPONENTS LLVHSupport)
set(HERMES_ENABLE_RTTI OFF)

# synthTraceParser uses exceptions but not rtti
add_hermes_library(synthTraceParser SynthTraceParser.cpp LINK_LIBS hermesSupport hermesParser synthTrace)

set(HERMES_ENABLE_EH OFF)

# compileJS uses neither exceptions nor RTTI
add_hermes_library(compileJS STATIC CompileJS.cpp LINK_LIBS hermesPublic)

# Restore EH and RTTI (Note: At the time of writing, there is no usage of
# add_hermes_library either after this line in this file or in a sub directory.
# However, the values are restored anyways for the sake of sanity.)
set(HERMES_ENABLE_EH ON)
set(HERMES_ENABLE_RTTI ON)

add_library(libhermes SHARED ${api_sources})

Expand Down

0 comments on commit 16c07b0

Please sign in to comment.