From fa24b4abb92d18662352d0c42482f81f4844af84 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Mon, 19 May 2025 13:10:00 +0100 Subject: [PATCH 1/5] Remove cling 1.0 support --- CMakeLists.txt | 27 +++------ .../Compatibility.h | 59 +------------------ .../CppInterOp.cpp | 4 -- unittests/CMakeLists.txt | 1 - unittests/CppInterOp/CUDATest.cpp | 14 +---- unittests/CppInterOp/ScopeReflectionTest.cpp | 4 -- 6 files changed, 11 insertions(+), 98 deletions(-) rename lib/{Interpreter => CppInterOp}/Compatibility.h (87%) rename lib/{Interpreter => CppInterOp}/CppInterOp.cpp (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bf78a214..23bd30128 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,13 +67,13 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) include(GNUInstallDirs) ## Define supported version of clang and llvm - set(CLANG_MIN_SUPPORTED 13.0) + set(CLANG_MIN_SUPPORTED 16.0) set(CLANG_MAX_SUPPORTED "20.1.x") set(CLANG_VERSION_UPPER_BOUND 21.0.0) - set(LLD_MIN_SUPPORTED 13.0) + set(LLD_MIN_SUPPORTED 16.0) set(LLD_MAX_SUPPORTED "20.1.x") set(LLD_VERSION_UPPER_BOUND 21.0.0) - set(LLVM_MIN_SUPPORTED 13.0) + set(LLVM_MIN_SUPPORTED 16.0) set(LLVM_MAX_SUPPORTED "20.1.x") set(LLVM_VERSION_UPPER_BOUND 21.0.0) @@ -230,21 +230,12 @@ endif() message(STATUS "Found supported version: Clang ${CLANG_PACKAGE_VERSION}") message(STATUS "Using ClangConfig.cmake in: ${Clang_DIR}") - ## Clang 13 require c++14 or later, Clang 16 require c++17 or later. - if (CLANG_VERSION_MAJOR GREATER_EQUAL 16) - if (NOT CMAKE_CXX_STANDARD) - set (CMAKE_CXX_STANDARD 17) - endif() - if (CMAKE_CXX_STANDARD LESS 17) - message(fatal "LLVM/CppInterOp requires c++17 or later") - endif() - elseif (CLANG_VERSION_MAJOR GREATER_EQUAL 13) - if (NOT CMAKE_CXX_STANDARD) - set (CMAKE_CXX_STANDARD 14) - endif() - if (CMAKE_CXX_STANDARD LESS 14) - message(fatal "LLVM/CppInterOp requires c++14 or later") - endif() + ## Clang 16 require c++17 or later. + if (NOT CMAKE_CXX_STANDARD) + set (CMAKE_CXX_STANDARD 17) + endif() + if (CMAKE_CXX_STANDARD LESS 17) + message(fatal "LLVM/CppInterOp requires c++17 or later") endif() ## Find supported Cling diff --git a/lib/Interpreter/Compatibility.h b/lib/CppInterOp/Compatibility.h similarity index 87% rename from lib/Interpreter/Compatibility.h rename to lib/CppInterOp/Compatibility.h index 45d778cee..b2d174c75 100644 --- a/lib/Interpreter/Compatibility.h +++ b/lib/CppInterOp/Compatibility.h @@ -122,12 +122,8 @@ getSymbolAddress(cling::Interpreter& I, llvm::StringRef IRName) { llvm::orc::SymbolNameVector Names; llvm::orc::ExecutionSession& ES = Jit.getExecutionSession(); Names.push_back(ES.intern(IRName)); -#if CLANG_VERSION_MAJOR < 16 - return llvm::make_error(Names); -#else return llvm::make_error(ES.getSymbolStringPool(), std::move(Names)); -#endif // CLANG_VERSION_MAJOR } inline void codeComplete(std::vector& Results, @@ -208,9 +204,6 @@ namespace compat { inline std::unique_ptr createClangInterpreter(std::vector& args) { -#if CLANG_VERSION_MAJOR < 16 - auto ciOrErr = clang::IncrementalCompilerBuilder::create(args); -#else auto has_arg = [](const char* x, llvm::StringRef match = "cuda") { llvm::StringRef Arg = x; Arg = Arg.trim().ltrim('-'); @@ -240,15 +233,12 @@ createClangInterpreter(std::vector& args) { DeviceCI = std::move(*devOrErr); } auto ciOrErr = CudaEnabled ? CB.CreateCudaHost() : CB.CreateCpp(); -#endif // CLANG_VERSION_MAJOR < 16 + if (!ciOrErr) { llvm::logAllUnhandledErrors(ciOrErr.takeError(), llvm::errs(), "Failed to build Incremental compiler:"); return nullptr; } -#if CLANG_VERSION_MAJOR < 16 - auto innerOrErr = clang::Interpreter::create(std::move(*ciOrErr)); -#else (*ciOrErr)->LoadRequestedPlugins(); if (CudaEnabled) DeviceCI->LoadRequestedPlugins(); @@ -256,7 +246,6 @@ createClangInterpreter(std::vector& args) { CudaEnabled ? clang::Interpreter::createWithCUDA(std::move(*ciOrErr), std::move(DeviceCI)) : clang::Interpreter::create(std::move(*ciOrErr)); -#endif // CLANG_VERSION_MAJOR < 16 if (!innerOrErr) { llvm::logAllUnhandledErrors(innerOrErr.takeError(), llvm::errs(), @@ -303,29 +292,15 @@ inline void maybeMangleDeclName(const clang::GlobalDecl& GD, RawStr.flush(); } -// Clang 13 - Initial implementation of Interpreter and clang-repl -// Clang 14 - Add new Interpreter methods: getExecutionEngine, -// getSymbolAddress, getSymbolAddressFromLinkerName -// Clang 15 - Add new Interpreter methods: Undo // Clang 18 - Add new Interpreter methods: CodeComplete inline llvm::orc::LLJIT* getExecutionEngine(clang::Interpreter& I) { -#if CLANG_VERSION_MAJOR >= 14 auto* engine = &llvm::cantFail(I.getExecutionEngine()); return const_cast(engine); -#else - assert(0 && "Not implemented in Clang <14!"); - return nullptr; -#endif } inline llvm::Expected getSymbolAddress(clang::Interpreter& I, llvm::StringRef IRName) { -#if CLANG_VERSION_MAJOR < 14 - assert(0 && "Not implemented in Clang <14!"); - return llvm::createStringError(llvm::inconvertibleErrorCode(), - "Not implemented in Clang <14!"); -#endif // CLANG_VERSION_MAJOR < 14 auto AddrOrErr = I.getSymbolAddress(IRName); if (llvm::Error Err = AddrOrErr.takeError()) @@ -343,7 +318,6 @@ getSymbolAddress(clang::Interpreter& I, clang::GlobalDecl GD) { inline llvm::Expected getSymbolAddressFromLinkerName(clang::Interpreter& I, llvm::StringRef LinkerName) { -#if CLANG_VERSION_MAJOR >= 14 const auto& DL = getExecutionEngine(I)->getDataLayout(); char GlobalPrefix = DL.getGlobalPrefix(); std::string LinkerNameTmp(LinkerName); @@ -354,21 +328,10 @@ getSymbolAddressFromLinkerName(clang::Interpreter& I, if (llvm::Error Err = AddrOrErr.takeError()) return std::move(Err); return AddrOrErr->getValue(); -#else - assert(0 && "Not implemented in Clang <14!"); - return llvm::createStringError(llvm::inconvertibleErrorCode(), - "Not implemented in Clang <14!"); -#endif } inline llvm::Error Undo(clang::Interpreter& I, unsigned N = 1) { -#if CLANG_VERSION_MAJOR >= 15 return I.Undo(N); -#else - assert(0 && "Not implemented in Clang <15!"); - return llvm::createStringError(llvm::inconvertibleErrorCode(), - "Not implemented in Clang <15!"); -#endif } inline void codeComplete(std::vector& Results, @@ -421,34 +384,14 @@ using Interpreter = Cpp::Interpreter; namespace compat { // Clang >= 14 change type name to string (spaces formatting problem) -#if CLANG_VERSION_MAJOR >= 14 inline std::string FixTypeName(const std::string type_name) { return type_name; } -#else -inline std::string FixTypeName(const std::string type_name) { - std::string result = type_name; - size_t pos = 0; - while ((pos = result.find(" [", pos)) != std::string::npos) { - result.erase(pos, 1); - pos++; - } - return result; -} -#endif -// Clang >= 16 change CLANG_LIBDIR_SUFFIX to CLANG_INSTALL_LIBDIR_BASENAME -#if CLANG_VERSION_MAJOR < 16 -#define CLANG_INSTALL_LIBDIR_BASENAME (llvm::Twine("lib") + CLANG_LIBDIR_SUFFIX) -#endif inline std::string MakeResourceDir(llvm::StringRef Dir) { llvm::SmallString<128> P(Dir); llvm::sys::path::append(P, CLANG_INSTALL_LIBDIR_BASENAME, "clang", -#if CLANG_VERSION_MAJOR < 16 - CLANG_VERSION_STRING -#else CLANG_VERSION_MAJOR_STRING -#endif ); return std::string(P.str()); } diff --git a/lib/Interpreter/CppInterOp.cpp b/lib/CppInterOp/CppInterOp.cpp similarity index 99% rename from lib/Interpreter/CppInterOp.cpp rename to lib/CppInterOp/CppInterOp.cpp index 1710b91b6..4db557311 100755 --- a/lib/Interpreter/CppInterOp.cpp +++ b/lib/CppInterOp/CppInterOp.cpp @@ -3046,11 +3046,7 @@ namespace Cpp { std::string detected_resource_dir = outs.back(); std::string version = -#if CLANG_VERSION_MAJOR < 16 - CLANG_VERSION_STRING; -#else CLANG_VERSION_MAJOR_STRING; -#endif // We need to check if the detected resource directory is compatible. if (llvm::sys::path::filename(detected_resource_dir) != version) return ""; diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index cff329553..0ea65be87 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -11,7 +11,6 @@ if(EMSCRIPTEN) set(gtest_libs gtest gmock) else() set(gtest_libs gtest gtest_main) - # Clang prior than clang13 (I think) merges both gmock into gtest. if (TARGET gmock) list(APPEND gtest_libs gmock gmock_main) endif() diff --git a/unittests/CppInterOp/CUDATest.cpp b/unittests/CppInterOp/CUDATest.cpp index f697007cf..756ef3c59 100644 --- a/unittests/CppInterOp/CUDATest.cpp +++ b/unittests/CppInterOp/CUDATest.cpp @@ -9,10 +9,6 @@ using namespace TestUtils; static bool HasCudaSDK() { auto supportsCudaSDK = []() { -#if CLANG_VERSION_MAJOR < 16 - // FIXME: Enable this for cling. - return false; -#endif // CLANG_VERSION_MAJOR < 16 if (!Cpp::CreateInterpreter({}, {"--cuda"})) return false; return Cpp::Declare("__global__ void test_func() {}" @@ -24,10 +20,6 @@ static bool HasCudaSDK() { static bool HasCudaRuntime() { auto supportsCuda = []() { -#if CLANG_VERSION_MAJOR < 16 - // FIXME: Enable this for cling. - return false; -#endif //CLANG_VERSION_MAJOR < 16 if (!HasCudaSDK()) return false; @@ -43,11 +35,7 @@ static bool HasCudaRuntime() { return hasCuda; } -#if CLANG_VERSION_MAJOR < 16 -TEST(DISABLED_CUDATest, Sanity) { -#else TEST(CUDATest, Sanity) { -#endif // CLANG_VERSION_MAJOR < 16 #ifdef _WIN32 GTEST_SKIP() << "Disabled on Windows. Needs fixing."; #endif @@ -76,4 +64,4 @@ TEST(CUDATest, CUDARuntime) { GTEST_SKIP() << "Skipping CUDA tests as CUDA runtime not found"; EXPECT_TRUE(HasCudaRuntime()); -} \ No newline at end of file +} diff --git a/unittests/CppInterOp/ScopeReflectionTest.cpp b/unittests/CppInterOp/ScopeReflectionTest.cpp index 0b3908085..d965fafef 100644 --- a/unittests/CppInterOp/ScopeReflectionTest.cpp +++ b/unittests/CppInterOp/ScopeReflectionTest.cpp @@ -859,14 +859,10 @@ template constexpr T pi = T(3.1415926535897932385L); auto* VD = cast((Decl*)Instance1); VarTemplateDecl* VDTD1 = VD->getSpecializedTemplate(); EXPECT_TRUE(VDTD1->isThisDeclarationADefinition()); -#if CLANG_VERSION_MAJOR > 13 #if CLANG_VERSION_MAJOR <= 18 TemplateArgument TA1 = (*VD->getTemplateArgsInfo())[0].getArgument(); #else TemplateArgument TA1 = (*VD->getTemplateArgsAsWritten())[0].getArgument(); -#endif // CLANG_VERSION_MAJOR -#else - TemplateArgument TA1 = VD->getTemplateArgsInfo()[0].getArgument(); #endif // CLANG_VERSION_MAJOR EXPECT_TRUE(TA1.getAsType()->isIntegerType()); } From c53c9c869f72a9311594058d7b9a41ebf54d6b50 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Wed, 28 May 2025 14:51:11 +0100 Subject: [PATCH 2/5] Update changes after fixing merge commit --- lib/CppInterOp/CXCppInterOp.cpp | 2 -- lib/CppInterOp/Compatibility.h | 3 +-- lib/CppInterOp/CppInterOp.cpp | 7 +------ 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/CppInterOp/CXCppInterOp.cpp b/lib/CppInterOp/CXCppInterOp.cpp index ddfd07513..a5e6eb07f 100644 --- a/lib/CppInterOp/CXCppInterOp.cpp +++ b/lib/CppInterOp/CXCppInterOp.cpp @@ -200,9 +200,7 @@ CXTypeKind cxtype_GetTypeKind(QualType T) { TKCASE(Elaborated); TKCASE(Pipe); TKCASE(Attributed); -#if CLANG_VERSION_MAJOR >= 16 TKCASE(BTFTagAttributed); -#endif TKCASE(Atomic); default: return CXType_Unexposed; diff --git a/lib/CppInterOp/Compatibility.h b/lib/CppInterOp/Compatibility.h index 43f6a32c9..977603ea0 100644 --- a/lib/CppInterOp/Compatibility.h +++ b/lib/CppInterOp/Compatibility.h @@ -390,8 +390,7 @@ inline std::string FixTypeName(const std::string type_name) { inline std::string MakeResourceDir(llvm::StringRef Dir) { llvm::SmallString<128> P(Dir); llvm::sys::path::append(P, CLANG_INSTALL_LIBDIR_BASENAME, "clang", - CLANG_VERSION_MAJOR_STRING - ); + CLANG_VERSION_MAJOR_STRING); return std::string(P.str()); } diff --git a/lib/CppInterOp/CppInterOp.cpp b/lib/CppInterOp/CppInterOp.cpp index 0cafbb113..3e53e2997 100755 --- a/lib/CppInterOp/CppInterOp.cpp +++ b/lib/CppInterOp/CppInterOp.cpp @@ -2981,12 +2981,7 @@ std::string DetectResourceDir(const char* ClangBinaryName /* = clang */) { std::string detected_resource_dir = outs.back(); - std::string version = -#if CLANG_VERSION_MAJOR < 16 - CLANG_VERSION_STRING; -#else - CLANG_VERSION_MAJOR_STRING; -#endif + std::string version = CLANG_VERSION_MAJOR_STRING; // We need to check if the detected resource directory is compatible. if (llvm::sys::path::filename(detected_resource_dir) != version) return ""; From 21d4371957e6921b563ae17998c9e8d70f3d2b69 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Wed, 28 May 2025 18:26:29 +0100 Subject: [PATCH 3/5] Fix documentation --- README.md | 12 ++++++------ docs/DevelopersDocumentation.rst | 12 ++++++------ docs/InstallationAndUsage.rst | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 40f67dd5c..988930f8d 100644 --- a/README.md +++ b/README.md @@ -193,9 +193,10 @@ Use the following build instructions to build on Linux and MacOS ```bash git clone https://github.com/root-project/cling.git cd ./cling/ -git checkout tags/v1.0 +git checkout tags/v1.2 +git apply -v ../CppInterOp/patches/llvm/cling1.2-LookupHelper.patch cd .. -git clone --depth=1 -b cling-llvm13 https://github.com/root-project/llvm-project.git +git clone --depth=1 -b cling-llvm18 https://github.com/root-project/llvm-project.git mkdir llvm-project/build cd llvm-project/build cmake -DLLVM_ENABLE_PROJECTS=clang \ @@ -214,7 +215,6 @@ cmake -DLLVM_ENABLE_PROJECTS=clang \ ../llvm cmake --build . --target clang --parallel $(nproc --all) cmake --build . --target cling --parallel $(nproc --all) -cmake --build . --target gtest_main --parallel $(nproc --all) ``` Use the following build instructions to build on Windows @@ -222,9 +222,10 @@ Use the following build instructions to build on Windows ```powershell git clone https://github.com/root-project/cling.git cd .\cling\ -git checkout tags/v1.0 +git checkout tags/v1.2 +git apply -v ..\CppInterOp\patches\llvm\cling1.2-LookupHelper.patch cd .. -git clone --depth=1 -b cling-llvm13 https://github.com/root-project/llvm-project.git +git clone --depth=1 -b cling-llvm18 https://github.com/root-project/llvm-project.git $env:ncpus = %NUMBER_OF_PROCESSORS% $env:PWD_DIR= $PWD.Path $env:CLING_DIR="$env:PWD_DIR\cling" @@ -243,7 +244,6 @@ cmake -DLLVM_ENABLE_PROJECTS=clang ` ../llvm cmake --build . --target clang --parallel $env:ncpus cmake --build . --target cling --parallel $env:ncpus -cmake --build . --target gtest_main --parallel $env:ncpus ``` Note the 'llvm-project' directory location. On linux and MacOS you execute the following diff --git a/docs/DevelopersDocumentation.rst b/docs/DevelopersDocumentation.rst index 925acc1cb..49dc28bac 100644 --- a/docs/DevelopersDocumentation.rst +++ b/docs/DevelopersDocumentation.rst @@ -132,9 +132,10 @@ build instructions to build on Linux and MacOS git clone https://github.com/root-project/cling.git cd ./cling/ - git checkout tags/v1.0 + git checkout tags/v1.2 + git apply -v ../CppInterOp/patches/llvm/cling1.2-LookupHelper.patch cd .. - git clone --depth=1 -b cling-llvm13 https://github.com/root-project/llvm-project.git + git clone --depth=1 -b cling-llvm18 https://github.com/root-project/llvm-project.git mkdir llvm-project/build cd llvm-project/build cmake -DLLVM_ENABLE_PROJECTS=clang \ @@ -153,7 +154,6 @@ build instructions to build on Linux and MacOS ../llvm cmake --build . --target clang --parallel $(nproc --all) cmake --build . --target cling --parallel $(nproc --all) - cmake --build . --target gtest_main --parallel $(nproc --all) Use the following build instructions to build on Windows @@ -161,9 +161,10 @@ Use the following build instructions to build on Windows git clone https://github.com/root-project/cling.git cd .\cling\ - git checkout tags/v1.0 + git checkout tags/v1.2 + git apply -v ..\CppInterOp\patches\llvm\cling1.2-LookupHelper.patch cd .. - git clone --depth=1 -b cling-llvm13 https://github.com/root-project/llvm-project.git + git clone --depth=1 -b cling-llvm18 https://github.com/root-project/llvm-project.git $env:ncpus = %NUMBER_OF_PROCESSORS% $env:PWD_DIR= $PWD.Path $env:CLING_DIR="$env:PWD_DIR\cling" @@ -182,7 +183,6 @@ Use the following build instructions to build on Windows ../llvm cmake --build . --target clang --parallel $env:ncpus cmake --build . --target cling --parallel $env:ncpus - cmake --build . --target gtest_main --parallel $env:ncpus Note the 'llvm-project' directory location. On linux and MacOS you execute the following diff --git a/docs/InstallationAndUsage.rst b/docs/InstallationAndUsage.rst index d4f172cda..6c602e03d 100644 --- a/docs/InstallationAndUsage.rst +++ b/docs/InstallationAndUsage.rst @@ -132,9 +132,10 @@ build instructions to build on Linux and MacOS git clone https://github.com/root-project/cling.git cd ./cling/ - git checkout tags/v1.0 + git checkout tags/v1.2 + git apply -v ../CppInterOp/patches/llvm/cling1.2-LookupHelper.patch cd .. - git clone --depth=1 -b cling-llvm13 https://github.com/root-project/llvm-project.git + git clone --depth=1 -b cling-llvm18 https://github.com/root-project/llvm-project.git mkdir llvm-project/build cd llvm-project/build cmake -DLLVM_ENABLE_PROJECTS=clang \ @@ -153,7 +154,6 @@ build instructions to build on Linux and MacOS ../llvm cmake --build . --target clang --parallel $(nproc --all) cmake --build . --target cling --parallel $(nproc --all) - cmake --build . --target gtest_main --parallel $(nproc --all) Use the following build instructions to build on Windows @@ -161,9 +161,10 @@ Use the following build instructions to build on Windows git clone https://github.com/root-project/cling.git cd .\cling\ - git checkout tags/v1.0 + git checkout tags/v1.2 + git apply -v ..\CppInterOp\patches\llvm\cling1.2-LookupHelper.patch cd .. - git clone --depth=1 -b cling-llvm13 https://github.com/root-project/llvm-project.git + git clone --depth=1 -b cling-llvm18 https://github.com/root-project/llvm-project.git $env:ncpus = %NUMBER_OF_PROCESSORS% $env:PWD_DIR= $PWD.Path $env:CLING_DIR="$env:PWD_DIR\cling" @@ -182,7 +183,6 @@ Use the following build instructions to build on Windows ../llvm cmake --build . --target clang --parallel $env:ncpus cmake --build . --target cling --parallel $env:ncpus - cmake --build . --target gtest_main --parallel $env:ncpus Note the 'llvm-project' directory location. On linux and MacOS you execute the following From 39b2093900e20b287022a331f4d3e94ab36624ce Mon Sep 17 00:00:00 2001 From: mcbarton Date: Thu, 29 May 2025 15:05:13 +0100 Subject: [PATCH 4/5] Apply PR suggestions --- unittests/CppInterOp/CUDATest.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/unittests/CppInterOp/CUDATest.cpp b/unittests/CppInterOp/CUDATest.cpp index d3c371b17..45b41c94d 100644 --- a/unittests/CppInterOp/CUDATest.cpp +++ b/unittests/CppInterOp/CUDATest.cpp @@ -10,6 +10,10 @@ using namespace TestUtils; static bool HasCudaSDK() { auto supportsCudaSDK = []() { +#ifdef CPPINTEROP_USE_CLING + // FIXME: Enable this for cling. + return false; +#endif if (!Cpp::CreateInterpreter({}, {"--cuda"})) return false; return Cpp::Declare("__global__ void test_func() {}" @@ -21,6 +25,10 @@ static bool HasCudaSDK() { static bool HasCudaRuntime() { auto supportsCuda = []() { +#ifdef CPPINTEROP_USE_CLING + // FIXME: Enable this for cling. + return false; +#endif if (!HasCudaSDK()) return false; @@ -36,7 +44,11 @@ static bool HasCudaRuntime() { return hasCuda; } +#ifdef CPPINTEROP_USE_CLING +TEST(DISABLED_CUDATest, Sanity) { +#else TEST(CUDATest, Sanity) { +#endif #ifdef _WIN32 GTEST_SKIP() << "Disabled on Windows. Needs fixing."; #endif From c2527806a4e6dd05a01fde999fc7d09cd8e6d2a6 Mon Sep 17 00:00:00 2001 From: mcbarton Date: Thu, 29 May 2025 15:09:20 +0100 Subject: [PATCH 5/5] Apply PR suggestion --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 23bd30128..8b2df5b4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,13 +67,25 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) include(GNUInstallDirs) ## Define supported version of clang and llvm +if (CPPINTEROP_USE_CLING) + set(CLANG_MIN_SUPPORTED 18.0) +else() set(CLANG_MIN_SUPPORTED 16.0) +endif(CPPINTEROP_USE_CLING) set(CLANG_MAX_SUPPORTED "20.1.x") set(CLANG_VERSION_UPPER_BOUND 21.0.0) +if (CPPINTEROP_USE_CLING) + set(LLD_MIN_SUPPORTED 18.0) +else() set(LLD_MIN_SUPPORTED 16.0) +endif(CPPINTEROP_USE_CLING) set(LLD_MAX_SUPPORTED "20.1.x") set(LLD_VERSION_UPPER_BOUND 21.0.0) +if (CPPINTEROP_USE_CLING) + set(LLVM_MIN_SUPPORTED 18.0) +else() set(LLVM_MIN_SUPPORTED 16.0) +endif(CPPINTEROP_USE_CLING) set(LLVM_MAX_SUPPORTED "20.1.x") set(LLVM_VERSION_UPPER_BOUND 21.0.0)