Skip to content

Commit

Permalink
Make a switch to choose between dynamic library to clang-cpp or stati…
Browse files Browse the repository at this point in the history
…c linking against clangTooling
  • Loading branch information
doxygen committed Jul 20, 2020
1 parent 3803bec commit 3b6ac9e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ option(build_doc "Build user manual (HTML and PDF)" OFF)
option(build_doc_chm "Build user manual (CHM)" OFF)
option(use_sqlite3 "Add support for sqlite3 output [experimental]." OFF)
option(use_libclang "Add support for libclang parsing." OFF)
option(static_libclang "Link to a statically compiled version of LLVM/libclang." OFF)
option(win_static "Link with /MT in stead of /MD on windows" OFF)
option(english_only "Only compile in support for the English language" OFF)
option(force_qt4 "Forces doxywizard to build using Qt4 even if Qt5 is installed" OFF)
Expand Down
6 changes: 5 additions & 1 deletion addon/doxyapp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ doxyapp.cpp
add_sanitizers(doxyapp)

if (use_libclang)
set(CLANG_LIBS libclang clang-cpp ${llvm_libs})
if (static_libclang)
set(CLANG_LIBS libclang clangTooling ${llvm_libs})
else()
set(CLANG_LIBS libclang clang-cpp ${llvm_libs})
endif()
endif()

target_link_libraries(doxyapp
Expand Down
6 changes: 5 additions & 1 deletion addon/doxyparse/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ doxyparse.cpp
add_sanitizers(doxyparse)

if (use_libclang)
set(CLANG_LIBS libclang clang-cpp ${llvm_libs})
if (static_libclang)
set(CLANG_LIBS libclang clangTooling ${llvm_libs})
else()
set(CLANG_LIBS libclang clang-cpp ${llvm_libs})
endif()
endif()

target_link_libraries(doxyparse
Expand Down
9 changes: 7 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,14 @@ if (use_libclang)
endif()
include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})
llvm_map_components_to_libnames(llvm_libs support)
if (static_libclang)
llvm_map_components_to_libnames(llvm_libs support core option)
set(CLANG_LIBS libclang clangTooling ${llvm_libs})
else() # dynamically linked version of clang
llvm_map_components_to_libnames(llvm_libs support)
set(CLANG_LIBS libclang clang-cpp ${llvm_libs})
endif()
target_compile_definitions(doxygen PRIVATE ${LLVM_DEFINITIONS})
set(CLANG_LIBS libclang clang-cpp ${llvm_libs})
endif()

target_link_libraries(doxygen
Expand Down

0 comments on commit 3b6ac9e

Please sign in to comment.