From f75c8d77a20da0f9bd96513d1aee4f16b5cd500e Mon Sep 17 00:00:00 2001 From: Martchus Date: Thu, 14 Nov 2019 17:18:49 +0100 Subject: [PATCH] Fix finding LibTooling when 'clang-cpp' target is used See https://releases.llvm.org/9.0.0/tools/clang/docs/ReleaseNotes.html#build-system-changes --- generator/CMakeLists.txt | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/generator/CMakeLists.txt b/generator/CMakeLists.txt index 37c9420..cb86a43 100644 --- a/generator/CMakeLists.txt +++ b/generator/CMakeLists.txt @@ -39,17 +39,22 @@ endif () # link against c++utilities use_cpp_utilities() -# find Clang for LibTooling; adding clangTooling should be sufficient as it pulls all transitive dependencies +# find Clang for LibTooling find_package(Clang REQUIRED) -list(APPEND PRIVATE_LIBRARIES - clangTooling - clangFrontend - clangSerialization - clangSema - clangAST - clangLex - clangBasic - LLVM) +if (TARGET clang-cpp) + list(APPEND PRIVATE_LIBRARIES clang-cpp LLVM) +else () + list( + APPEND PRIVATE_LIBRARIES + clangTooling + clangFrontend + clangSerialization + clangSema + clangAST + clangLex + clangBasic + LLVM) +endif () # also add reflective_rapidjson which is header-only but might pull additional include dirs for RapidJSON list(APPEND PRIVATE_LIBRARIES reflective_rapidjson)