Skip to content

Commit 33bfa39

Browse files
committed
Improve CMake check when both interpreter modes are OFF
The style of this check is improved, we can use an elseif instead of going through another if block to add the REPL definitions. Even though this is fine in theory, setting both flags to ON, caused this to add both definitions, which is fixed by the previous commit.
1 parent da9daef commit 33bfa39

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

CMakeLists.txt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,16 +293,15 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
293293
# In rare cases we might want to have clang installed in a different place
294294
# than llvm and the header files should be found first (even though the
295295
# LLVM_INCLUDE_DIRS) contain clang headers, too.
296-
if (CPPINTEROP_USE_CLING)
296+
if(CPPINTEROP_USE_CLING)
297297
add_definitions(-DCPPINTEROP_USE_CLING)
298298
include_directories(SYSTEM ${CLING_INCLUDE_DIRS})
299-
else()
300-
if (NOT CPPINTEROP_USE_REPL)
301-
message(FATAL_ERROR "We need either CPPINTEROP_USE_CLING or CPPINTEROP_USE_REPL")
302-
endif()
299+
elseif(CPPINTEROP_USE_REPL)
303300
add_definitions(-DCPPINTEROP_USE_REPL)
301+
else()
302+
message(FATAL_ERROR "We need either CPPINTEROP_USE_CLING or CPPINTEROP_USE_REPL")
303+
endif()
304304

305-
endif(CPPINTEROP_USE_CLING)
306305
include_directories(SYSTEM ${CLANG_INCLUDE_DIRS})
307306
include_directories(SYSTEM ${LLVM_INCLUDE_DIRS})
308307
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})

0 commit comments

Comments
 (0)