Skip to content

Commit

Permalink
Add missing LLVMSupport dependency of tool if building deps from sources
Browse files Browse the repository at this point in the history
  • Loading branch information
Manu343726 committed Jan 20, 2019
1 parent f218ea8 commit c6b6f91
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
7 changes: 6 additions & 1 deletion tool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 9 additions & 1 deletion tool/external/external.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c6b6f91

Please sign in to comment.