Merge pull request #63 from qinwf/windows-appveyor

add Windows CI with MSVC
This commit is contained in:
Yanyi Wu 2016-04-27 19:13:49 +08:00
commit 4d8d793da5
3 changed files with 40 additions and 2 deletions

32
appveyor.yml Normal file
View File

@ -0,0 +1,32 @@
os: Visual Studio 2015
platform: x64
# clone directory
clone_folder: c:\projects\cppjieba
# scripts to run before build
before_build:
- echo Running cmake...
- cd c:\projects\cppjieba
- cmake .
build:
project: ALL_BUILD.vcxproj # path to Visual Studio solution or project
# scripts to run after build
after_build:
- cd Debug
- demo.exe
- load_test.exe
- cd ..
- COPY .\test\Debug\test.run.exe .\test\test.run.exe
- cd test
- test.run.exe
- cd ..
- 7z a c:\projects\all.zip * -tzip
- cd c:\projects
artifacts:
- path: all.zip
name: all.zip

View File

@ -1,3 +1,5 @@
INCLUDE_DIRECTORIES(./ include)
ADD_LIBRARY(gtest STATIC src/gtest-all.cc)
TARGET_LINK_LIBRARIES(gtest pthread)
if(NOT MSVC)
TARGET_LINK_LIBRARIES(gtest pthread)
endif()

View File

@ -15,5 +15,9 @@ ADD_EXECUTABLE(test.run
pre_filter_test.cpp
unicode_test.cpp
)
TARGET_LINK_LIBRARIES(test.run gtest pthread)
if(MSVC)
TARGET_LINK_LIBRARIES(test.run gtest)
else()
TARGET_LINK_LIBRARIES(test.run gtest pthread)
endif()