Skip to content

Commit c71069f

Browse files
authored
Make -DUSE_REPL=On default (#360)
Fixes #255
1 parent e8b84c1 commit c71069f

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

.github/workflows/ci.yml

-3
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,6 @@ jobs:
11911191
else
11921192
cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
11931193
-DUSE_CLING=OFF \
1194-
-DUSE_REPL=ON \
11951194
-DCPPINTEROP_INCLUDE_DOCS=${{ matrix.documentation }} \
11961195
-DLLVM_DIR=$LLVM_BUILD_DIR/lib/cmake/llvm \
11971196
-DClang_DIR=$LLVM_BUILD_DIR/lib/cmake/clang \
@@ -1285,7 +1284,6 @@ jobs:
12851284
{
12861285
cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} `
12871286
-DUSE_CLING=OFF `
1288-
-DUSE_REPL=ON `
12891287
-DLLVM_DIR="$env:LLVM_BUILD_DIR\lib\cmake\llvm" `
12901288
-DLLVM_ENABLE_WERROR=On `
12911289
-DClang_DIR="$env:LLVM_BUILD_DIR\lib\cmake\clang" -DCODE_COVERAGE=${{ env.CODE_COVERAGE }} -DCMAKE_INSTALL_PREFIX="$env:CPPINTEROP_DIR" ..\
@@ -1580,7 +1578,6 @@ jobs:
15801578
else
15811579
emcmake cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
15821580
-DUSE_CLING=OFF \
1583-
-DUSE_REPL=ON \
15841581
-DCMAKE_PREFIX_PATH=$PREFIX \
15851582
-DLLVM_DIR=$LLVM_BUILD_DIR/lib/cmake/llvm \
15861583
-DLLD_DIR=$LLVM_BUILD_DIR/lib/cmake/lld \

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
6060
endif()
6161

6262
option(USE_CLING "Use Cling as backend" OFF)
63-
option(USE_REPL "Use clang-repl as backend" OFF)
63+
option(USE_REPL "Use clang-repl as backend" ON)
6464

6565
if (USE_CLING AND USE_REPL)
6666
message(FATAL_ERROR "We can only use Cling (USE_CLING=On) or Repl (USE_REPL=On), but not both of them.")

lib/Interpreter/Compatibility.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ inline void codeComplete(std::vector<std::string>& Results,
183183

184184
#endif // USE_CLING
185185

186-
#ifdef USE_REPL
186+
#ifndef USE_CLING
187187

188188
#include "DynamicLibraryManager.h"
189189
#include "clang/AST/Mangle.h"

unittests/CppInterOp/InterpreterTest.cpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "cling/Interpreter/Interpreter.h"
88
#endif // USE_CLING
99

10-
#ifdef USE_REPL
10+
#ifndef USE_CLING
1111
#include "clang/Interpreter/Interpreter.h"
1212
#endif // USE_REPL
1313

@@ -111,7 +111,8 @@ TEST(InterpreterTest, CreateInterpreter) {
111111
EXPECT_TRUE(Cpp::GetNamed("cpp17"));
112112
EXPECT_FALSE(Cpp::GetNamed("cppUnknown"));
113113

114-
#ifdef USE_REPL
114+
115+
#ifndef USE_CLING
115116
// C API
116117
auto CXI = clang_createInterpreterFromRawPtr(I);
117118
auto CLI = clang_Interpreter_getClangInterpreter(CXI);
@@ -190,7 +191,7 @@ TEST(InterpreterTest, ExternalInterpreterTest) {
190191
if (llvm::sys::RunningOnValgrind())
191192
GTEST_SKIP() << "XFAIL due to Valgrind report";
192193

193-
#ifdef USE_REPL
194+
#ifndef USE_CLING
194195
llvm::ExitOnError ExitOnErr;
195196
clang::IncrementalCompilerBuilder CB;
196197
CB.SetCompilerArgs({"-std=c++20"});
@@ -203,7 +204,7 @@ if (llvm::sys::RunningOnValgrind())
203204
std::unique_ptr<clang::Interpreter> I =
204205
ExitOnErr(clang::Interpreter::create(std::move(CI)));
205206
auto ExtInterp = I.get();
206-
#endif
207+
#endif // USE_REPL
207208

208209
#ifdef USE_CLING
209210
std::string MainExecutableName = sys::fs::getMainExecutable(nullptr, nullptr);
@@ -223,9 +224,10 @@ if (llvm::sys::RunningOnValgrind())
223224
#endif
224225
EXPECT_TRUE(Cpp::GetInterpreter()) << "External Interpreter not set";
225226

226-
#ifdef USE_REPL
227+
#ifndef USE_CLING
227228
I.release();
228229
#endif
230+
229231
#ifdef USE_CLING
230232
delete ExtInterp;
231233
#endif

0 commit comments

Comments
 (0)