Permalink
Browse files

Build System Refactor

* Use Modern CMake Practices
* Better/Simplified dependencies graph
* Use Dashel and Enki as submodules
* MSVC Support
* Travis Integration
* Appveyor Integration
* CPack NSIS
  • Loading branch information...
cor3ntin committed Mar 7, 2018
1 parent 1f4ea49 commit 23366dafbdbbd3c9b02d951f38ac0a350e3c0dc8
Showing 1,049 changed files with 66,621 additions and 64,666 deletions.
View
@@ -0,0 +1,156 @@
version: '{build}'
init:
- git config --global core.autocrlf input
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/cor3ntin/1327dbf8aedab79f9fa305c001190268/raw/05155caad3a68c48be5f6873c3aca6ad8a30e31a/rdp.ps1'))
matrix:
fast_finish: true
skip_branch_with_pr: true
install:
- mkdir C:\projects\deps
- cd C:\projects\deps
# Install Bonjour
- 7z x "%APPVEYOR_BUILD_FOLDER%\third_party\bonjour\bonjoursdksetup.exe"
- if [%platform%]==[x64] cd C:\projects\deps && msiexec /i C:\projects\deps\Bonjour64.msi /qb /quiet
- if [%platform%]==[x64] cd C:\projects\deps && msiexec /i C:\projects\deps\BonjourSDK64.msi /qb /quiet
- if [%platform%]==[x86] cd C:\projects\deps && msiexec /i C:\projects\deps\Bonjour.msi /qb /quiet
- if [%platform%]==[x86] cd C:\projects\deps && msiexec /i C:\projects\deps\BonjourSDK.msi /qb /quiet
# Use msys packages for the mingw builds
- if [%COMPILER%]==[MinGW] (
%BASH% -lc "pacman -R catgets libcatgets --noconfirm"
)
- if [%COMPILER%]==[MinGW] if [%ARCH%]==[x86] %BASH% -lc "pacman --noconfirm -Sy -d mingw-w64-i686-{binutils,gcc,gcc-libs,cmake,qt5,qwt-qt5,libxml2,SDL2}"
- if [%COMPILER%]==[MinGW] if [%ARCH%]==[x64] %BASH% -lc "pacman --noconfirm -Sy -d mingw-w64-x86_64-{binutils,gcc,gcc-libs,cmake,qt5,qwt-qt5,libxml2,SDL2}"
# Install cmake
- if [%USE_VS_TOOLCHAIN%]==[true] (
cd C:\projects\deps &&
appveyor DownloadFile %CMAKE_URL% -FileName cmake.zip &&
7z x cmake.zip -oC:\projects\deps > nul &&
move C:\projects\deps\cmake-* C:\projects\deps\cmake &&
set "PATH=C:\projects\deps\cmake\bin;%PATH%"
cmake --version
)
#Install LLVM to have a newer clang cl
- if [%COMPILER%]==[ClangCL] (
cd C:\projects\deps &&
appveyor DownloadFile %LLVM_URL% -FileName llvm.exe &&
7z x llvm.exe -oC:\projects\deps\llvm > nul &&
set "PATH=C:\projects\deps\llvm\bin;%PATH%" &&
set "LLD_LINK=C:\projects\deps\llvm\bin\lld-link.exe"
)
# Install SDL ( for msvc & clang)
- if [%USE_VS_TOOLCHAIN%]==[true] (
appveyor DownloadFile %SDL_URL% -FileName sdl.zip &&
7z x sdl.zip -oC:\projects\deps\sdl > nul
)
- appveyor DownloadFile %NINJA_URL% -FileName ninja.zip
- 7z x ninja.zip -oC:\projects\deps\ninja > nul
- set "PATH=C:\projects\deps\ninja;%PATH%"
- ninja --version
# NSIS
- ps: |
if (Test-Path "C:/Program Files (x86)/NSIS/makensis.exe") {
echo "using nsis from cache"
} else {
choco install -y nsis.install
}
- cmd: SET PATH=%PATH%;C:\Program Files (x86)\NSIS
# Blockly deps
- if [%USE_VS_TOOLCHAIN%]==[true] python -m pip install -U pip setuptools wheel
- if [%USE_VS_TOOLCHAIN%]==[true] python -m pip install beautifulsoup4 lxml
- if [%COMPILER%]==[MinGW] appveyor DownloadFile %https://bootstrap.pypa.io/get-pip.py% -FileName get-pip.py
- if [%COMPILER%]==[MinGW] (
%BASH% -x -lc "python2 get-pip.py --user && python2 -m pip install -U pip setuptools wheel && python2 -m pip install beautifulsoup4 lxml"
)
before_build:
- cd "%APPVEYOR_BUILD_FOLDER%"
- if [%USE_VS_TOOLCHAIN%]==[true] (
set "PATH=%QT5%\bin;%PATH%" &&
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %ARCH%
)
- git submodule init
- git submodule update --recursive --remote
- if NOT DEFINED APPVEYOR_PULL_REQUEST_NUMBER git clone https://github.com/aseba-community/thymio-blockly-standalone.git thymio-blockly-standalone --branch master --recurse-submodules
build_script:
- cd "%APPVEYOR_BUILD_FOLDER%"
- mkdir build
- cd build
- if [%COMPILER%]==[MinGW] if [%ARCH%]==[x86] set MinGWPath="/mingw32"
- if [%COMPILER%]==[MinGW] if [%ARCH%]==[x64] set MinGWPath="/mingw64"
- if [%COMPILER%]==[MinGW] (
%BASH% -x -lc "cd '%APPVEYOR_BUILD_FOLDER%\\build' && export PATH=\"%MinGWPath%/bin:${PATH}\" && cmake .. -GNinja -DBUILD_SHARED_LIBS=OFF -DCMAKE_PREFIX_PATH='%MinGWPath%;/c/Program Files/Bonjour SDK' && ninja -v"
)
- if [%COMPILER%]==[ClangCL] (
cmake .. -GNinja -DBUILD_SHARED_LIBS=OFF "-DCMAKE_TOOLCHAIN_FILE=%APPVEYOR_BUILD_FOLDER%\windows\clang-cl-toolchain.cmake" "-DCMAKE_LINKER=%LLD_LINK%" "-DCMAKE_PREFIX_PATH=%QT5%;C:\Program Files\Bonjour SDK" -DCMAKE_BUILD_TYPE=Release &&
ninja -v &&
ctest
)
- if [%COMPILER%]==[MSVC] (
cmake .. -GNinja -DBUILD_SHARED_LIBS=OFF "-DCMAKE_TOOLCHAIN_FILE=%APPVEYOR_BUILD_FOLDER%\windows\cl-toolchain.cmake" "-DCMAKE_PREFIX_PATH=%QT5%;C:\Program Files\Bonjour SDK" -DCMAKE_BUILD_TYPE=Release &&
ninja -v &&
ctest
)
cache:
- '%MSYS_CACHE%'
- C:\ProgramData\chocolatey\bin -> appveyor.yml
- C:\ProgramData\chocolatey\lib -> appveyor.yml
- 'C:\Program Files (x86)\NSIS'
image: Visual Studio 2017
platform: x64
environment:
NINJA_URL: https://github.com/ninja-build/ninja/releases/download/v1.6.0/ninja-win.zip
SDL_URL: https://libsdl.org/release/SDL2-devel-2.0.7-VC.zip
CMAKE_URL: https://cmake.org/files/v3.8/cmake-3.8.0-win64-x64.zip
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: "-t7z -m0=lzma -mx=5"
matrix:
- ARCH: x86
QT5: C:\Qt\5.10.0\msvc2015
COMPILER: MSVC
USE_VS_TOOLCHAIN: true
- ARCH: x64
COMPILER: MSVC
QT5: C:\Qt\5.10.0\msvc2017_64
USE_VS_TOOLCHAIN: true
#- COMPILER: MinGW
#ARCH: x86
#BASH: C:\msys64\usr\bin\bash
#MSYS_CACHE: C:\msys64\var\cache\pacman\pkg
#- platform: x64
#COMPILER: MinGW
#ARCH: x64
#BASH: C:\msys64\usr\bin\bash
#MSYS_CACHE: C:\msys64\var\cache\pacman\pkg
- platform: x64
COMPILER: ClangCL
ARCH: x64
LLVM_URL: http://prereleases.llvm.org/win-snapshots/LLVM-7.0.0-r323406-win64.exe
LLVM_VERSION: 7.0
USE_VS_TOOLCHAIN: true
QT5: C:\Qt\5.10.0\msvc2017_64
View
@@ -4,3 +4,5 @@
.DS_Store
.directory
docs/*/_build
dashel/
enki/
View
@@ -1 +1,6 @@
[submodule "enki"]
path = enki
url = https://github.com/enki-community/enki
[submodule "dashel"]
path = dashel
url = https://github.com/aseba-community/dashel
View
@@ -0,0 +1,74 @@
language: cpp
cache:
ccache: true
directories:
- $HOME/Library/Caches/Homebrew
matrix:
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-6.0 main'
- sourceline: 'ppa:corentinjabot/cmake-backport'
packages:
- g++-6
- clang-6.0
- cmake-data
- cmake
- libudev-dev
- qt5-qmake
- qtbase5-dev
- qttools5-dev
- qtbase5-dev-tools
- libqt5help5
- libqt5svg5-dev
- libqt5x11extras5-dev
- libqt5opengl5-dev
- libboost-python-dev
- ninja-build
- libxml2-dev
- libsdl2-dev
- libavahi-compat-libdnssd-dev
- valgrind
- lcov
env: COMPILER=clang-6.0 CXX_COMPILER=clang++-6.0
- os: osx
osx_image: xcode8
env: COMPILER=clang CXX_COMPILER=clang++
before_script:
- cd ${TRAVIS_BUILD_DIR}
- git submodule update --remote
before_install:
- |
set -e
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update
brew bundle
fi
set +e
script:
- |
set -e
export CC=${COMPILER}
export CXX=${CXX_COMPILER}
export CFLAGS="-Wall -Wextra -Wno-unused-parameter"
export CXXFLAGS="-Wall -Wextra -Wno-unused-parameter"
cd ${TRAVIS_BUILD_DIR}
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}:$(brew --prefix qt)"
#export PATH="(brew --prefix llvm)/bin:${PATH}"
fi
mkdir build && cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF .. #-DCMAKE_CXX_CLANG_TIDY="clang-tidy\;-checks=-clang-diagnostic-error,clang-analyzer-*"
ninja -v
#CTEST_OUTPUT_ON_FAILURE=1 ctest
set +e
View
@@ -0,0 +1,7 @@
brew 'qt'
brew 'ninja'
brew 'qwt'
brew 'valgrind'
brew 'cmake'
brew 'ccache'
brew 'llvm', args: ['with-clang', 'with-clang-extra-tools']
Oops, something went wrong.

0 comments on commit 23366da

Please sign in to comment.