From c6b6f9194103350b4b8dc7f25c7d4be1f31de43e Mon Sep 17 00:00:00 2001 From: Manu343726 Date: Sun, 20 Jan 2019 15:38:32 +0100 Subject: [PATCH] Add missing LLVMSupport dependency of tool if building deps from sources --- tool/CMakeLists.txt | 7 ++++++- tool/external/external.cmake | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tool/CMakeLists.txt b/tool/CMakeLists.txt index d162d4c..e9353ed 100644 --- a/tool/CMakeLists.txt +++ b/tool/CMakeLists.txt @@ -63,7 +63,12 @@ else() define_tinyrefl_version_variables(tinyrefl-tool) define_llvm_version_variables(tinyrefl-tool) - target_link_libraries(tinyrefl-tool PRIVATE tinyrefl_externals_cppast tinyrefl_externals_cppfs tinyrefl_externals_fmt) + target_link_libraries(tinyrefl-tool PRIVATE + tinyrefl_externals_cppast + tinyrefl_externals_cppfs + tinyrefl_externals_fmt + tinyrefl_externals_llvm_support) + if(NOT MSVC) # LLVMSupport is compiled with RTTI disabled target_compile_options(tinyrefl-tool PRIVATE -fno-rtti) diff --git a/tool/external/external.cmake b/tool/external/external.cmake index bd9c811..e570cff 100644 --- a/tool/external/external.cmake +++ b/tool/external/external.cmake @@ -50,7 +50,11 @@ else() if(NOT fmt_FOUND) external_dependency(fmt-header-only ${TINYREFL_FMT_REPO_URL} ${TINYREFL_FMT_VERSION}) - add_library(tinyrefl_externals_fmt ALIAS fmt::fmt-header-only) + + # Here we cannot define an ALIAS library since fmt::fmt-header-only itself is + # already an alias + add_library(tinyrefl_externals_fmt INTERFACE) + target_link_libraries(tinyrefl_externals_fmt INTERFACE fmt::fmt-header-only) else() add_library(tinyrefl_externals_fmt INTERFACE) target_link_libraries(tinyrefl_externals_fmt INTERFACE fmt::fmt) @@ -117,6 +121,10 @@ else() message(STATUS "llvm cmake path: ${LLVM_CMAKE_PATH}") message(STATUS "clang cmake path: ${CLANG_CMAKE_PATH}") + + find_package(LLVM ${TINYREFL_LLVM_VERSION} REQUIRED EXACT CONFIG PATHS "${LLVM_CMAKE_PATH}" NO_DEFAULT_PATH) + add_library(tinyrefl_externals_llvm_support INTERFACE) + target_link_libraries(tinyrefl_externals_llvm_support INTERFACE LLVMSupport) else() add_library(tinyrefl_externals_cppast INTERFACE) target_link_libraries(tinyrefl_externals_cppast INTERFACE cppast::cppast)