Skip to content

Commit

Permalink
Fixes for cross platform build with new LLVM/CLANG version
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri van Heesch committed Aug 20, 2017
1 parent 82221a3 commit b0aae61
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 61 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Expand Up @@ -39,7 +39,8 @@ endif()
set(MACOS_VERSION_MIN 10.5)
if (use_libclang)
set(clang "1" CACHE INTERNAL "used in settings.h")
find_package(LibClang REQUIRED)
find_package(LLVM CONFIG REQUIRED)
find_package(Clang CONFIG REQUIRED)

This comment has been minimized.

Copy link
@christoffer-nylen

christoffer-nylen Aug 29, 2017

find_package(Clang CONFIG REQUIRED) currently results in the following problem with the debian packaging of clang/libclang. The code is correct but I just thought you might find it interesting.

if (${CMAKE_SYSTEM} MATCHES "Darwin")
set(MACOS_VERSION_MIN 10.11)
endif()
Expand Down
55 changes: 0 additions & 55 deletions cmake/FindLibClang.cmake

This file was deleted.

17 changes: 12 additions & 5 deletions src/CMakeLists.txt
Expand Up @@ -248,13 +248,20 @@ add_executable(doxygen main.cpp)
if (use_libclang)
find_package(LLVM REQUIRED CONFIG)
find_package(Clang REQUIRED CONFIG)
target_compile_features(_doxygen PRIVATE cxx_alignof)
target_compile_options(_doxygen PRIVATE -stdlib=libc++ -std=c++11)
target_compile_features(doxygen PRIVATE cxx_alignof)
target_compile_options(doxygen PRIVATE -stdlib=libc++ -std=c++11)
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
target_compile_features(_doxygen PRIVATE cxx_alignof)
target_compile_features(doxygen PRIVATE cxx_alignof)
target_compile_options(_doxygen PRIVATE -stdlib=libc++ -std=c++11)
target_compile_options(doxygen PRIVATE -stdlib=libc++ -std=c++11)
elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
target_compile_options(_doxygen PRIVATE -std=c++11)
target_compile_options(doxygen PRIVATE -std=c++11)
endif()
include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})
llvm_map_components_to_libnames(llvm_libs support core option)
target_compile_definitions(doxygen PRIVATE ${LLVM_DEFINITIONS})
set(CLANG_LIBS ${llvm_libs} ${CLANG_LIBS} clangTooling)
set(CLANG_LIBS libclang clangTooling ${llvm_libs})
endif()

target_link_libraries(doxygen
Expand Down
1 change: 1 addition & 0 deletions src/portable.cpp
Expand Up @@ -180,6 +180,7 @@ int portable_system(const char *command,const char *args,bool commandHasConsole)
}
}
#endif
return 1; // we should never get here

}

Expand Down

0 comments on commit b0aae61

Please sign in to comment.