Skip to content

Commit

Permalink
Fix compile on Windows + MSYS2-MinGW64 (MaskRay#46)
Browse files Browse the repository at this point in the history
1. libClangDriver.a shipped by MSYS2 needs -lversion which is not
   included in CMAKE_CXX_STANDARD_LIBRARIES by default.
2. Use string literal for DEFAULT_RESOURCE_DIRECTORY to support
   backslashes in path.
  • Loading branch information
Riatre authored and MaskRay committed Aug 8, 2018
1 parent b9e1c2e commit 344ade0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ endif()
### Definitions

target_compile_definitions(ccls PRIVATE
DEFAULT_RESOURCE_DIRECTORY="${Clang_RESOURCE_DIR}")
DEFAULT_RESOURCE_DIRECTORY=R"\(${Clang_RESOURCE_DIR}\)")

### Includes

Expand Down
3 changes: 3 additions & 0 deletions cmake/FindClang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,7 @@ if(Clang_FOUND AND NOT TARGET Clang::Clang)
find_package(Curses REQUIRED)
find_package(ZLIB REQUIRED)
set_property(TARGET Clang::Clang PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES "${_Clang_LIBRARIES};${CURSES_LIBRARIES};${ZLIB_LIBRARIES}")
if(MINGW)
set_property(TARGET Clang::Clang APPEND_STRING PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES ";version")
endif()
endif()

0 comments on commit 344ade0

Please sign in to comment.