Skip to content

Commit 5e73901

Browse files
committed
allow LLVM to be built without support for exceptions
This makes it easier to link against OS builds like Debian's
1 parent ed7a2c2 commit 5e73901

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,6 @@ if (BUILD_LLVM_UTILS OR BUILD_TV)
180180
message(FATAL_ERROR "LLVM must be built with '-DLLVM_ENABLE_RTTI=ON'")
181181
endif()
182182

183-
if (NOT LLVM_ENABLE_EH)
184-
message(FATAL_ERROR "LLVM must be built with '-DLLVM_ENABLE_EH=ON'")
185-
endif()
186-
187183
list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_DIR}")
188184
include(AddLLVM)
189185

@@ -206,14 +202,17 @@ if (BUILD_LLVM_UTILS OR BUILD_TV)
206202
add_llvm_executable(alive-tv
207203
"tools/alive-tv.cpp"
208204
)
205+
target_compile_options(alive-tv PRIVATE -fexceptions)
209206

210207
add_llvm_executable(quick-fuzz
211208
"tools/quick-fuzz.cpp"
212209
)
210+
target_compile_options(quick-fuzz PRIVATE -fexceptions)
213211

214212
add_llvm_executable(alive-exec
215213
"tools/alive-exec.cpp"
216214
)
215+
target_compile_options(alive-exec PRIVATE -fexceptions)
217216

218217
else()
219218
set(LLVM_UTIL_SRCS "")

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ actual location to that in the resultant error message may help.
9999
cd $LLVM2_HOME
100100
mkdir build
101101
cd build
102-
cmake -GNinja -DLLVM_ENABLE_RTTI=ON -DLLVM_ENABLE_EH=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="llvm;clang" ../llvm
102+
cmake -GNinja -DLLVM_ENABLE_RTTI=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="llvm;clang" ../llvm
103103
ninja
104104
```
105105

tv/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ configure_file(
2222
)
2323

2424
target_link_libraries(tv PRIVATE ${ALIVE_LIBS_LLVM} ${Z3_LIBRARIES} ${HIREDIS_LIBRARIES})
25+
target_compile_options(tv PRIVATE -fexceptions)
2526

2627
if(APPLE)
2728
set_target_properties(tv PROPERTIES

0 commit comments

Comments
 (0)