summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorDeniz Bahadir <Bagira80@users.noreply.github.com>2020-07-29 14:06:02 (GMT)
committerGitHub <noreply@github.com>2020-07-29 14:06:02 (GMT)
commit30cfbe69de24e6d1d6b718971168be1ac246e3e2 (patch)
tree2083d8a8b7ae0e8cb66d065b28ea4a69a276e029 /src/CMakeLists.txt
parent517ec716de0f3a08fcd3bed2626b776a36c663f5 (diff)
downloadDoxygen-30cfbe69de24e6d1d6b718971168be1ac246e3e2.zip
Doxygen-30cfbe69de24e6d1d6b718971168be1ac246e3e2.tar.gz
Doxygen-30cfbe69de24e6d1d6b718971168be1ac246e3e2.tar.bz2
Fix compiling with clang parser support and with Clang compiler, too (#7922)
* Fix compiling with clang parser support and with Clang compiler, too When compiling the code with the Clang compiler a new CMake option `use_libc++` is available which is enabled by default. It determines if the Clang compiler should use libc++ as its C++ standard library or uses the systems default (e.g. libstdc++ on Linux). Disabling that option might help when compiling with Clang and the option `use_libclang` is enabled but the associated library was not built with libc++ as its C++ standard library. Additionally, the doxygen executable that is created when CMake option `static_libclang` is enabled, no longer crashes. * Removing obsolete (and wrong) forcing of -std=c++11 for GCC The entire Doxygen project already requires the compiler to run in C++14 mode. That setting is applied globally in the top-most `CMakeLists.txt` file. Therefore, forcing GCC to run in C++11 mode in `src/CMakeLists.txt` is wrong and obsolete.
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5ba80b7..8b11a2d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -322,25 +322,23 @@ if (use_libclang)
cmake_minimum_required(VERSION 3.1)
target_compile_features(doxymain PRIVATE cxx_alignof)
target_compile_features(doxygen PRIVATE cxx_alignof)
- target_compile_options(doxymain PRIVATE -stdlib=libc++)
- target_compile_options(doxygen PRIVATE -stdlib=libc++)
- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- target_compile_options(doxymain PRIVATE -std=c++11)
- target_compile_options(doxygen PRIVATE -std=c++11)
+ if (use_libc++)
+ target_compile_options(doxymain PRIVATE -stdlib=libc++)
+ target_compile_options(doxygen PRIVATE -stdlib=libc++)
+ endif()
endif()
include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})
if (static_libclang)
- llvm_map_components_to_libnames(llvm_libs support core option)
- set(CLANG_LIBS libclang clangTooling ${llvm_libs})
+ set(CLANG_LIBS libclang clangTooling)
else() # dynamically linked version of clang
- llvm_map_components_to_libnames(llvm_libs support)
- set(CLANG_LIBS libclang clang-cpp ${llvm_libs})
+ llvm_config(doxymain USE_SHARED support)
+ set(CLANG_LIBS libclang clang-cpp)
endif()
target_compile_definitions(doxygen PRIVATE ${LLVM_DEFINITIONS})
endif()
-target_link_libraries(doxygen
+target_link_libraries(doxygen PRIVATE
doxymain
doxycfg
qtools