Skip to content

Commit e5f7a93

Browse files
DsoTsinMaskRay
authored andcommitted
Fix VS2017 build issues and add Appveyor CI script (#118)
1 parent 985f5ec commit e5f7a93

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

.appveyor.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: "{build}"
2+
3+
os: Visual Studio 2017
4+
5+
platform:
6+
- x64
7+
8+
build:
9+
parallel: true # enable MSBuild parallel builds
10+
verbosity: minimal
11+
12+
install:
13+
- if not exist llvm.tar.xz appveyor DownloadFile "https://ziglang.org/deps/llvm+clang-7.0.0-win64-msvc-release.tar.xz" -FileName llvm.tar.xz
14+
- 7z e -txz llvm.tar.xz
15+
- 7z x llvm.tar
16+
- git submodule update --init --recursive
17+
build_script:
18+
- cmake -G"Visual Studio 15 2017 Win64" -H. -Bbuild -DCMAKE_BUILD_TYPE=Release -DSYSTEM_CLANG=ON -DCLANG_ROOT=C:\projects\ccls\llvm+clang-7.0.0-win64-msvc-release
19+
- cmake --build build --target ccls --config Release
20+
21+
artifacts:
22+
- path: build\Release

CMakeLists.txt

+4-3
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,17 @@ if(MSVC)
5050
/EHsc
5151
/D_CRT_SECURE_NO_WARNINGS # don't try to use MSVC std replacements
5252
/W3 # roughly -Wall
53-
/wd4996 # disable loguru unsafe warnings
54-
/wd4722 # ignores warning C4722
55-
# (destructor never returns) in loguru
53+
/wd4996 # ignore deprecated declaration
5654
/wd4267 # ignores warning C4267
5755
# (conversion from 'size_t' to 'type'),
5856
# roughly -Wno-sign-compare
5957
/wd4800
6058
/wd4068 # Disable unknown pragma warning
59+
/std:c++17
6160
$<$<CONFIG:Debug>:/FS>
6261
)
62+
# relink system libs
63+
target_link_libraries(ccls PRIVATE Mincore.lib)
6364
else()
6465
# Common GCC/Clang(Linux) options
6566
target_compile_options(ccls PRIVATE

cmake/FindClang.cmake

+4-3
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,10 @@ if(Clang_FOUND AND NOT TARGET Clang::Clang)
143143
set_target_properties(Clang::Clang PROPERTIES
144144
IMPORTED_LOCATION ${Clang_LIBRARY}
145145
INTERFACE_INCLUDE_DIRECTORIES "${Clang_INCLUDE_DIR};${Clang_BUILD_INCLUDE_DIR};${LLVM_INCLUDE_DIR};${LLVM_BUILD_INCLUDE_DIR}")
146-
147-
find_package(Curses REQUIRED)
148-
find_package(ZLIB REQUIRED)
146+
if(NOT MSVC)
147+
find_package(Curses REQUIRED)
148+
find_package(ZLIB REQUIRED)
149+
endif()
149150
set_property(TARGET Clang::Clang PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES "${_Clang_LIBRARIES};${CURSES_LIBRARIES};${ZLIB_LIBRARIES}")
150151
if(MINGW)
151152
set_property(TARGET Clang::Clang APPEND_STRING PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES ";version")

0 commit comments

Comments
 (0)