From 69573109173878aeace35dc3a870956dd2ad1b8f Mon Sep 17 00:00:00 2001 From: alesiong Date: Thu, 11 May 2017 08:48:46 +0800 Subject: [PATCH 1/6] add samples gen in ci --- .travis.yml | 36 ++++++++++++++++++------------------ appveyor.yml | 17 ++++++++++------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index 009a02e..3b5a7ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,35 +45,35 @@ notifications: sudo: false after_success: | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - if [[ "$CXX" == "g++-4.9" ]]; then + if [[ ( $TRAVIS_OS_NAME = linux ) && ( $CXX = g++-4.9 ) ]]; then cd $TRAVIS_BUILD_DIR chmod +x generateDocument.sh ./generateDocument.sh touch docs/.nojekyll - fi - fi - if [[ "$CXX" == "g++-4.9" ]]; then - CC="gcc" - fi - if [[ "$CXX" = "clang++-3.7" ]]; then - CC="clang" fi cd $TRAVIS_BUILD_DIR/build + OS_NAME=$TRAVIS_OS_NAME + if [[ "$TRAVIS_OS_NAME" = "osx" ]]; then + OS_NAME=macos + fi + if [ $TRAVIS_TAG ]; then mkdir release && cd release cmake ../.. -DTESTING=0 -DCMAKE_BUILD_TYPE=Release make -j - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - cp -r ../../src/include ./include - tar -czvf linux-$CC.tar.gz libcuhkszlib.a include - else - tar -cvf macos.tar libcuhkszlib.a - cd ../../src - tar -rvf ../build/release/macos.tar include - cd ../build/release - tar -cvzf macos-$CC.tar.gz @macos.tar + if [[ "$CXX" == "g++-4.9" ]]; then + CC="gcc" + fi + if [[ "$CXX" = "clang++-3.7" ]]; then + CC="clang" + fi + cp -r ../../src/include ./include + mkdir lib + mv libcuhkszlib.a lib/libcuhkszlib.a + tar -czvf $OS_NAME-$CC.tar.gz lib include + if [[ (( $TRAVIS_OS_NAME = linux ) && ( $CXX = g++-4.9 )) || (( $TRAVIS_OS_NAME = osx ) && ( $CXX = clang ))]]; then + tar -czvf $OS_NAME-samples.tar.gz samples/* fi fi diff --git a/appveyor.yml b/appveyor.yml index 4ec731a..ab6f562 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -87,8 +87,7 @@ test_script: after_build: - ps: | - if ($env:TOOLSET -eq "mingw") - { + if ($env:TOOLSET -eq "mingw") { if ($env:appveyor_repo_tag -eq "true") { mkdir release cd release @@ -99,14 +98,18 @@ after_build: } else { 7z a -tzip windows-$env:PLATFORM-mingw.zip ..\build\libcuhkszlib.a ..\src\include } - } - else - { + } else { + mkdir lib if ($env:appveyor_repo_tag -eq "true") { - 7z a -tzip windows-$env:PLATFORM-msvc-$env:TOOLSET.zip ..\build\Debug ..\build\Release ..\src\include + cp -r ..\build\Debug lib + cp -r ..\build\Release lib + if ($env:Toolset -eq "2017") { + 7z a -tzip windows-$env:PLATFORM-samples.zip ..\build\samples\Release\* + } } else { - 7z a -tzip windows-$env:PLATFORM-msvc-$env:TOOLSET.zip ..\build\Debug ..\src\include + cp -r ..\build\Debug lib } + 7z a -tzip windows-$env:PLATFORM-msvc-$env:TOOLSET.zip lib ..\src\include } artifacts: From 68c5a6c4fb0d36ca89eab1e2c8c4893db979fbf5 Mon Sep 17 00:00:00 2001 From: alesiong Date: Thu, 11 May 2017 09:06:10 +0800 Subject: [PATCH 2/6] fix bugs in samples gen --- .travis.yml | 5 ++++- appveyor.yml | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3b5a7ba..6d8a175 100644 --- a/.travis.yml +++ b/.travis.yml @@ -72,7 +72,10 @@ after_success: | mkdir lib mv libcuhkszlib.a lib/libcuhkszlib.a tar -czvf $OS_NAME-$CC.tar.gz lib include - if [[ (( $TRAVIS_OS_NAME = linux ) && ( $CXX = g++-4.9 )) || (( $TRAVIS_OS_NAME = osx ) && ( $CXX = clang ))]]; then + if [[ (( $TRAVIS_OS_NAME = linux ) && ( $CXX = g++-4.9 )) || (( $TRAVIS_OS_NAME = osx ) && ( $CXX = clang++ ))]]; then + rm -rf samples/*.cmake + rm -rf samples/Makefile + rm -rf samples/CMakeFiles tar -czvf $OS_NAME-samples.tar.gz samples/* fi fi diff --git a/appveyor.yml b/appveyor.yml index ab6f562..9599656 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -88,22 +88,25 @@ test_script: after_build: - ps: | if ($env:TOOLSET -eq "mingw") { + mkdir lib if ($env:appveyor_repo_tag -eq "true") { mkdir release cd release cmake -G "$generator" ../.. -DTESTING=0 -DCMAKE_BUILD_TYPE=Release cmd /C 'cmake --build . -- -j' + cp libcuhkszlib.a ..\lib\libcuhkszlib.a cd .. - 7z a -tzip windows-$env:PLATFORM-mingw.zip ..\build\release\libcuhkszlib.a ..\src\include } else { - 7z a -tzip windows-$env:PLATFORM-mingw.zip ..\build\libcuhkszlib.a ..\src\include + cp libcuhkszlib.a ..\lib\libcuhkszlib.a } + 7z a -tzip windows-$env:PLATFORM-mingw.zip ..\build\lib ..\src\include } else { mkdir lib if ($env:appveyor_repo_tag -eq "true") { cp -r ..\build\Debug lib cp -r ..\build\Release lib if ($env:Toolset -eq "2017") { + cp ..\build\samples\EnglishWords.txt ..\build\samples\Release 7z a -tzip windows-$env:PLATFORM-samples.zip ..\build\samples\Release\* } } else { From c4bf9e5e4cebc1e6395950da1afb43db2125d23d Mon Sep 17 00:00:00 2001 From: alesiong Date: Thu, 11 May 2017 09:15:35 +0800 Subject: [PATCH 3/6] bugs in mingw on lib gen --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 9599656..0ba0a47 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -94,10 +94,10 @@ after_build: cd release cmake -G "$generator" ../.. -DTESTING=0 -DCMAKE_BUILD_TYPE=Release cmd /C 'cmake --build . -- -j' - cp libcuhkszlib.a ..\lib\libcuhkszlib.a + cp libcuhkszlib.a ..\lib cd .. } else { - cp libcuhkszlib.a ..\lib\libcuhkszlib.a + cp libcuhkszlib.a ..\lib } 7z a -tzip windows-$env:PLATFORM-mingw.zip ..\build\lib ..\src\include } else { From 5cc43600e4b6f9db7414f1aa7d44022c8c12c0b8 Mon Sep 17 00:00:00 2001 From: alesiong Date: Thu, 11 May 2017 09:49:40 +0800 Subject: [PATCH 4/6] add project files --- ide-project-files/clion/CMakeLists.txt | 11 +++ .../qt-msvc/CUHKSZLib-sample-project.pro | 14 ++++ .../qt/CUHKSZLib-sample-project.pro | 11 +++ ide-project-files/src/main.cpp | 10 +++ .../vs-x64/CUHKSZLib-sample-project.sln | 22 +++++ .../vs-x64/CUHKSZLib-sample-project.vcxproj | 83 +++++++++++++++++++ .../CUHKSZLib-sample-project.vcxproj.filters | 22 +++++ .../vs-x86/CUHKSZLib-sample-project.sln | 22 +++++ .../vs-x86/CUHKSZLib-sample-project.vcxproj | 83 +++++++++++++++++++ .../CUHKSZLib-sample-project.vcxproj.filters | 22 +++++ 10 files changed, 300 insertions(+) create mode 100644 ide-project-files/clion/CMakeLists.txt create mode 100755 ide-project-files/qt-msvc/CUHKSZLib-sample-project.pro create mode 100755 ide-project-files/qt/CUHKSZLib-sample-project.pro create mode 100755 ide-project-files/src/main.cpp create mode 100755 ide-project-files/vs-x64/CUHKSZLib-sample-project.sln create mode 100755 ide-project-files/vs-x64/CUHKSZLib-sample-project.vcxproj create mode 100755 ide-project-files/vs-x64/CUHKSZLib-sample-project.vcxproj.filters create mode 100755 ide-project-files/vs-x86/CUHKSZLib-sample-project.sln create mode 100755 ide-project-files/vs-x86/CUHKSZLib-sample-project.vcxproj create mode 100755 ide-project-files/vs-x86/CUHKSZLib-sample-project.vcxproj.filters diff --git a/ide-project-files/clion/CMakeLists.txt b/ide-project-files/clion/CMakeLists.txt new file mode 100644 index 0000000..232085d --- /dev/null +++ b/ide-project-files/clion/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.7) +project(cuhkszlib_cmake) + +set(CMAKE_CXX_STANDARD 11) + +INCLUDE_DIRECTORIES(include/) +LINK_DIRECTORIES(lib/) + +set(SOURCE_FILES src/main.cpp) +add_executable(cuhkszlib_cmake ${SOURCE_FILES}) +target_link_libraries(cuhkszlib_cmake cuhkszlib) \ No newline at end of file diff --git a/ide-project-files/qt-msvc/CUHKSZLib-sample-project.pro b/ide-project-files/qt-msvc/CUHKSZLib-sample-project.pro new file mode 100755 index 0000000..5909873 --- /dev/null +++ b/ide-project-files/qt-msvc/CUHKSZLib-sample-project.pro @@ -0,0 +1,14 @@ +TEMPLATE = app +CONFIG += console c++11 +CONFIG -= app_bundle +CONFIG -= qt + +INCLUDEPATH +=$$PWD/include +CONFIG(debug, debug|release) { + LIBS += $$PWD/lib/Debug/cuhkszlib.lib +} else { + LIBS += $$PWD/lib/Release/cuhkszlib.lib +} + + +SOURCES += src/main.cpp diff --git a/ide-project-files/qt/CUHKSZLib-sample-project.pro b/ide-project-files/qt/CUHKSZLib-sample-project.pro new file mode 100755 index 0000000..41adf9e --- /dev/null +++ b/ide-project-files/qt/CUHKSZLib-sample-project.pro @@ -0,0 +1,11 @@ +TEMPLATE = app +CONFIG += console c++11 +CONFIG -= app_bundle +CONFIG -= qt + +INCLUDEPATH +=$$PWD/include + +LIBS += $$PWD/lib/libcuhkszlib.a + + +SOURCES += src/main.cpp diff --git a/ide-project-files/src/main.cpp b/ide-project-files/src/main.cpp new file mode 100755 index 0000000..51aeaa4 --- /dev/null +++ b/ide-project-files/src/main.cpp @@ -0,0 +1,10 @@ +#include "random.h" +#include + +using namespace std; +using namespace cuhksz; + +int main() +{ + cout << randomDouble() << endl; +} diff --git a/ide-project-files/vs-x64/CUHKSZLib-sample-project.sln b/ide-project-files/vs-x64/CUHKSZLib-sample-project.sln new file mode 100755 index 0000000..67a3bea --- /dev/null +++ b/ide-project-files/vs-x64/CUHKSZLib-sample-project.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26403.7 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CUHKSZLib-sample-project", "CUHKSZLib-sample-project.vcxproj", "{3B6C0BED-7EE2-4BB5-8968-29068081692C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3B6C0BED-7EE2-4BB5-8968-29068081692C}.Debug|x64.ActiveCfg = Release|x64 + {3B6C0BED-7EE2-4BB5-8968-29068081692C}.Debug|x64.Build.0 = Release|x64 + {3B6C0BED-7EE2-4BB5-8968-29068081692C}.Release|x64.ActiveCfg = Release|x64 + {3B6C0BED-7EE2-4BB5-8968-29068081692C}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/ide-project-files/vs-x64/CUHKSZLib-sample-project.vcxproj b/ide-project-files/vs-x64/CUHKSZLib-sample-project.vcxproj new file mode 100755 index 0000000..f56765c --- /dev/null +++ b/ide-project-files/vs-x64/CUHKSZLib-sample-project.vcxproj @@ -0,0 +1,83 @@ + + + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {3B6C0BED-7EE2-4BB5-8968-29068081692C} + CUHKSZLibsampleproject + 10.0.15063.0 + + + + Application + true + v141 + MultiByte + + + Application + false + v141 + true + MultiByte + + + + + + + + + + + + + + + .\include;$(IncludePath) + .\lib\Debug;$(LibraryPath) + + + .\include;$(IncludePath) + .\lib\Release;$(LibraryPath) + + + + Level3 + Disabled + true + + + cuhkszlib.lib;%(AdditionalDependencies) + + + + + Level3 + MaxSpeed + true + true + true + + + true + true + cuhkszlib.lib;%(AdditionalDependencies) + + + + + + + + + \ No newline at end of file diff --git a/ide-project-files/vs-x64/CUHKSZLib-sample-project.vcxproj.filters b/ide-project-files/vs-x64/CUHKSZLib-sample-project.vcxproj.filters new file mode 100755 index 0000000..41f0ee7 --- /dev/null +++ b/ide-project-files/vs-x64/CUHKSZLib-sample-project.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Sources + + + \ No newline at end of file diff --git a/ide-project-files/vs-x86/CUHKSZLib-sample-project.sln b/ide-project-files/vs-x86/CUHKSZLib-sample-project.sln new file mode 100755 index 0000000..a40a56f --- /dev/null +++ b/ide-project-files/vs-x86/CUHKSZLib-sample-project.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26403.7 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CUHKSZLib-sample-project", "CUHKSZLib-sample-project.vcxproj", "{3B6C0BED-7EE2-4BB5-8968-29068081692C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3B6C0BED-7EE2-4BB5-8968-29068081692C}.Debug|x86.ActiveCfg = Debug|Win32 + {3B6C0BED-7EE2-4BB5-8968-29068081692C}.Debug|x86.Build.0 = Debug|Win32 + {3B6C0BED-7EE2-4BB5-8968-29068081692C}.Release|x86.ActiveCfg = Release|Win32 + {3B6C0BED-7EE2-4BB5-8968-29068081692C}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/ide-project-files/vs-x86/CUHKSZLib-sample-project.vcxproj b/ide-project-files/vs-x86/CUHKSZLib-sample-project.vcxproj new file mode 100755 index 0000000..f254147 --- /dev/null +++ b/ide-project-files/vs-x86/CUHKSZLib-sample-project.vcxproj @@ -0,0 +1,83 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + 15.0 + {3B6C0BED-7EE2-4BB5-8968-29068081692C} + CUHKSZLibsampleproject + 10.0.15063.0 + + + + Application + true + v141 + MultiByte + + + Application + false + v141 + true + MultiByte + + + + + + + + + + + + + + + .\include;$(IncludePath) + .\lib\Debug;$(LibraryPath) + + + .\include;$(IncludePath) + .\lib\Release;$(LibraryPath) + + + + Level3 + Disabled + true + + + cuhkszlib.lib;%(AdditionalDependencies) + + + + + Level3 + MaxSpeed + true + true + true + + + true + true + cuhkszlib.lib;%(AdditionalDependencies) + + + + + + + + + \ No newline at end of file diff --git a/ide-project-files/vs-x86/CUHKSZLib-sample-project.vcxproj.filters b/ide-project-files/vs-x86/CUHKSZLib-sample-project.vcxproj.filters new file mode 100755 index 0000000..41f0ee7 --- /dev/null +++ b/ide-project-files/vs-x86/CUHKSZLib-sample-project.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Sources + + + \ No newline at end of file From c2beb86a95c32cb28afe6d80a6d61fafa87a1444 Mon Sep 17 00:00:00 2001 From: alesiong Date: Thu, 11 May 2017 15:03:40 +0800 Subject: [PATCH 5/6] update readme --- README.md | 78 +++++++++++++++++++++++++++++++++++++++++++--------- appveyor.yml | 2 +- 2 files changed, 66 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 5d9d340..6d9827e 100644 --- a/README.md +++ b/README.md @@ -8,40 +8,92 @@ [![Build status](https://ci.appveyor.com/api/projects/status/634a6wrw9xheiu0e/branch/master?svg=true)](https://ci.appveyor.com/project/alesiong/cuhkszlib-cmxvy/branch/master) ## Requirements -1. cmake >= 2.8 +### macOS and Linux +1. cmake (>= 2.8) 2. make -3. gcc/clang/msvc(2015+) +3. gcc/clang (need to have full C++11 support) + +### Windows +1. cmake (>= 2.8) +2. Visual Studio (>= 2015) with C++ component OR +3. MSYS2 ## Usage -### Compile +### Build + #### macOS and Linux -First clone the repository: +1. Clone the repository: ``` git clone --recursive https://github.com/cuhkshenzhen/CUHKSZLib.git ``` -Then configure and compile: +2. Configure and compile: ``` +cd CUHKSZLib mkdir build && cd build cmake .. make -j4 ``` +Add `-DCMAKE_BUILD_TYPE=Debug` or `-DCMAKE_BUILD_TYPE=Release` flags to `cmake` to specify the build type, `-DSAMPLES=0` to disable building samples, `-DTESTING=1` to enable building tests. +3. `libcuhkszlib.a` in the `build` directory is the library file + #### Windows (MSVC) 1. Download and install `cmake` from https://cmake.org/download/, make sure to choose the windows installer. 2. Make sure you have installed the Visual Studio with C++ component and it works. -3. Clone or download this repository -4. Open Cmake GUI, choose this repository as source and `CUHKSZLib/build` as build. (TODO: details and pics to be added) -5. Click `Configure`, and then click `Open Project` -6. Build with Visual Studio. +3. Download and install `git` from https://git-scm.com/downloads/, make sure to choose "Use Git from the Windows Command Prompt" during installation. +4. Clone the repository in command prompt with +``` +git clone --recursive https://github.com/cuhkshenzhen/CUHKSZLib.git +``` +5. Open Cmake GUI, choose this repository as source and `CUHKSZLib/build` as build. (TODO: details and pics to be added) +6. Click `Configure`, and then click `Open Project` +7. Build with Visual Studio. +8. Get the library file in the `build/Debug` or `build/Release` directory. + +#### Windows (MSYS2) +1. Open "MSYS2 MinGW 64-bit" shell +2. Install the dependencies with +``` +pacman -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake git +``` +3. Clone the repository +``` +git clone --recursive https://github.com/cuhkshenzhen/CUHKSZLib.git +``` +4. Configure and compile: +``` +cd CUHKSZLib +mkdir build && cd build +cmake .. -G "MSYS Makefiles" -DCMAKE_MAKE_PROGRAM=mingw32-make +mingw32-make -j4 +``` +Add `-DCMAKE_BUILD_TYPE=Debug` or `-DCMAKE_BUILD_TYPE=Release` flags to `cmake` to specify the build type, `-DSAMPLES=0` to disable building samples, `-DTESTING=1` to enable building tests. +5. `libcuhkszlib.a` in the `build` directory is the library file ### Generate Documentation with Doxygen #### macOS 1. Install brew 2. Run `brew install doxygen` -3. Make a directory called `docs` +3. Clone the repository 4. Run `doxygen Doxyfile` in the repository root. 5. Open `docs/index.html` with browser. ### Use with your code -The library file is the `build/libcuhkszlib.a`, and the include directory -is `src/include`. So add `src/include` into your inlcude path and `build/` to -your lib search path. And add `-lcuhkszlib` to your link flags. +The library file is `cuhkszlib.lib` if you use MSVC or `libcuhkszlib.a` otherwise, and the include directory is `src/include`. + +You can also download our prebuilt library in the Release section on Github. The prebuilt package inclues library file in the `lib` directory and headers in the `include` directory. The MSVC versions are also shipped with a Visual Studio solution file. + +If you are using IDEs other than Visual Studio, you can find the project file in `ide-project-files` directory. Currently we support CLion and Qt Creator. You need to copy the `ide-project-files/src` to your project directory. + +For example, you are using Qt Creator with MinGW32 on Windows. You copy the contents of `ide-project-files/qt` directory to anywhere you like, say `my-project`. Then you also need to copy `ide-project-files/src` to `myproject` directory, so that `my-project` now has a `.pro` file and a `src` directory. Now you can download the prebuilt library: `windows-x86-mingw.zip` and unzip the contents to `my-project`. + +## FAQ +1. Which prebuilt library should I choose? +> The release files are named as `os-(platform)-compiler`. So you need first to choose according to your operating system. Then if you are using windows, choose the platform(x86 for 32 bit and x64 for 64 bit) according to the **compiler** you use (not the system). (By the way, for macOS and Linux, all are for 64 bit) Finally of course, choose the compiler according to your compiler. A simple list: + +| Environment | Package to use | +|-----------------------------|-----------------------| +| Linux (default) | linux-gcc | +| macOS (default) | macos-clang | +| Visual Studio 2015 on win32 | windows-x86-msvc-2015 | +| Visual Studio 2015 on win64 | windows-x64-msvc-2015 | +| Qt Creator with MinGW32 | windows-x86-mingw | diff --git a/appveyor.yml b/appveyor.yml index 0ba0a47..4083c3f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -112,7 +112,7 @@ after_build: } else { cp -r ..\build\Debug lib } - 7z a -tzip windows-$env:PLATFORM-msvc-$env:TOOLSET.zip lib ..\src\include + 7z a -tzip windows-$env:PLATFORM-msvc-$env:TOOLSET.zip lib ..\src\include ..\ide-project-files\vs-$env:PLATFORM\* ..\ide-project-files\src } artifacts: From 9b3cac3ae821217b95f7063f2958dd5ab3d08a13 Mon Sep 17 00:00:00 2001 From: alesiong Date: Fri, 12 May 2017 07:59:11 +0800 Subject: [PATCH 6/6] fix ci bugs (deploy and build) --- .travis.yml | 39 +++++++++++++++++++-------------------- appveyor.yml | 4 ++-- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6d8a175..54e5f46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ compiler: script: - mkdir build && cd build - cmake .. -DTESTING=1 -DSAMPLES=0 -DCMAKE_BUILD_TYPE=Debug - - make -j + - make -j4 - CTEST_OUTPUT_ON_FAILURE=1 make test notifications: email: false @@ -61,7 +61,7 @@ after_success: | if [ $TRAVIS_TAG ]; then mkdir release && cd release cmake ../.. -DTESTING=0 -DCMAKE_BUILD_TYPE=Release - make -j + make -j4 if [[ "$CXX" == "g++-4.9" ]]; then CC="gcc" fi @@ -81,22 +81,21 @@ after_success: | fi deploy: - provider: pages - skip_cleanup: true - github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard - on: - branch: - master - condition: " (( $TRAVIS_OS_NAME = linux ) && ( $CXX = g++-4.9 ) && ($GITHUB_TOKEN)) " - local_dir: $TRAVIS_BUILD_DIR/docs + - provider: pages + skip_cleanup: true + github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard + on: + branch: + master + condition: " (( $TRAVIS_OS_NAME = linux ) && ( $CXX = g++-4.9 ) && ($GITHUB_TOKEN)) " + local_dir: $TRAVIS_BUILD_DIR/docs -deploy: - skip_cleanup: true - api_key: $RELEASE_TOKEN - provider: releases - file_glob: true - file: "*.tar.gz" - on: - all_branches: true - condition: " ($TRAVIS_TAG) " - tag: true + - provider: releases + skip_cleanup: true + api_key: $RELEASE_TOKEN + file_glob: true + file: "*.tar.gz" + on: + all_branches: true + condition: " ($TRAVIS_TAG) " + tag: true diff --git a/appveyor.yml b/appveyor.yml index 4083c3f..768da03 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -71,7 +71,7 @@ build: build_script: | cd build - if "%TOOLSET%"=="mingw" cmake --build . -- -j + if "%TOOLSET%"=="mingw" cmake --build . -- -j4 if "%APPVEYOR_REPO_TAG%"=="true" if NOT "%TOOLSET%"=="mingw" cmake --build . --config Release if NOT "%TOOLSET%"=="mingw" cmake --build . --config Debug @@ -93,7 +93,7 @@ after_build: mkdir release cd release cmake -G "$generator" ../.. -DTESTING=0 -DCMAKE_BUILD_TYPE=Release - cmd /C 'cmake --build . -- -j' + cmd /C 'cmake --build . -- -j4' cp libcuhkszlib.a ..\lib cd .. } else {