Skip to content

Commit da9daef

Browse files
committed
Move interpreter and testing options outside the standalone build condition
1 parent 59b7c11 commit da9daef

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ set(CMAKE_MODULE_PATH
66
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
77
)
88

9+
enable_language(CXX)
10+
set(CMAKE_CXX_EXTENSIONS NO)
11+
12+
option(CPPINTEROP_USE_CLING "Use Cling as backend" OFF)
13+
option(CPPINTEROP_USE_REPL "Use clang-repl as backend" ON)
14+
option(CPPINTEROP_ENABLE_TESTING "Enable the CppInterOp testing infrastructure." ON)
15+
16+
if (CPPINTEROP_USE_CLING AND CPPINTEROP_USE_REPL)
17+
message(FATAL_ERROR "We can only use Cling (${CPPINTEROP_USE_CLING}=On) or Repl (CPPINTEROP_USE_REPL=On), but not both of them.")
18+
endif()
919
# If we are not building as a part of LLVM, build CppInterOp as a standalone
1020
# project, using LLVM as an external library:
1121
if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
@@ -54,17 +64,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
5464
endif()
5565
endif()
5666

57-
enable_language(CXX)
58-
set(CMAKE_CXX_EXTENSIONS NO)
5967
include(GNUInstallDirs)
60-
option(CPPINTEROP_USE_CLING "Use Cling as backend" OFF)
61-
option(CPPINTEROP_USE_REPL "Use clang-repl as backend" ON)
62-
option(CPPINTEROP_ENABLE_TESTING "Enable the CppInterOp testing infrastructure." ON)
63-
64-
if (CPPINTEROP_USE_CLING AND CPPINTEROP_USE_REPL)
65-
message(FATAL_ERROR "We can only use Cling (CPPINTEROP_USE_CLING=On) or Repl (CPPINTEROP_USE_REPL=On), but not both of them.")
66-
endif()
67-
6868
## Define supported version of clang and llvm
6969

7070
set(CLANG_MIN_SUPPORTED 13.0)

0 commit comments

Comments
 (0)