diff options
-rwxr-xr-x | .ci/install.sh | 7 | ||||
-rwxr-xr-x | .ci/script.sh | 11 | ||||
-rw-r--r-- | .travis.yml | 8 | ||||
-rw-r--r-- | CMakeLists.txt | 24 | ||||
-rw-r--r-- | appveyor.yml | 2 | ||||
-rw-r--r-- | cmake/CompilerFlags.cmake | 26 | ||||
-rw-r--r-- | deps/cmake/Olm.cmake | 2 |
7 files changed, 46 insertions, 34 deletions
diff --git a/.ci/install.sh b/.ci/install.sh index f81f9265..ee172581 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -4,7 +4,8 @@ set -ex if [ $TRAVIS_OS_NAME == osx ]; then brew update - brew install qt5 lmdb clang-format ninja + brew install qt5 lmdb clang-format ninja libsodium spdlog + brew upgrade boost curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py sudo python get-pip.py @@ -23,6 +24,7 @@ if [ $TRAVIS_OS_NAME == linux ]; then QT_PKG="59" fi + sudo add-apt-repository -y ppa:chris-lea/libsodium sudo add-apt-repository -y ppa:beineri/opt-qt${QT_VERSION}-trusty sudo add-apt-repository -y ppa:george-edison55/cmake-3.x sudo apt-get update -qq @@ -32,5 +34,6 @@ if [ $TRAVIS_OS_NAME == linux ]; then qt${QT_PKG}svg \ qt${QT_PKG}multimedia \ cmake \ - liblmdb-dev + liblmdb-dev \ + libsodium-dev fi diff --git a/.ci/script.sh b/.ci/script.sh index a954eba6..f5966349 100755 --- a/.ci/script.sh +++ b/.ci/script.sh @@ -10,7 +10,16 @@ if [ $TRAVIS_OS_NAME == osx ]; then export CMAKE_PREFIX_PATH=/usr/local/opt/qt5 fi -make ci +# Build & install dependencies +mkdir -p .deps/usr/{lib,include}/ +cmake -Hdeps -B.deps \ + -DUSE_BUNDLED_BOOST=${USE_BUNDLED_BOOST} \ + -DUSE_BUNDLED_SPDLOG=${USE_BUNDLED_SPDLOG} +cmake --build .deps + +# Build nheko +cmake -GNinja -H. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo +cmake --build build if [ $TRAVIS_OS_NAME == osx ]; then make lint; diff --git a/.travis.yml b/.travis.yml index 2047a2db..3e631f30 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,8 @@ matrix: compiler: clang env: - DEPLOYMENT=1 + - USE_BUNDLED_BOOST=0 + - USE_BUNDLED_SPDLOG=0 - os: linux compiler: gcc env: @@ -22,6 +24,8 @@ matrix: - QT_VERSION="-5.10.1" - QT_PKG=510 - DEPLOYMENT=1 + - USE_BUNDLED_BOOST=1 + - USE_BUNDLED_SPDLOG=1 addons: apt: sources: ["ubuntu-toolchain-r-test"] @@ -33,6 +37,8 @@ matrix: - C_COMPILER=gcc-7 - QT_VERSION=571 - QT_PKG=57 + - USE_BUNDLED_BOOST=1 + - USE_BUNDLED_SPDLOG=1 addons: apt: sources: ["ubuntu-toolchain-r-test"] @@ -44,6 +50,8 @@ matrix: - C_COMPILER=clang-5.0 - QT_VERSION=592 - QT_PKG=59 + - USE_BUNDLED_BOOST=1 + - USE_BUNDLED_SPDLOG=1 addons: apt: sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-5.0"] diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fcd9f2c..63c718e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,6 +39,11 @@ if(APPLE) set(OPENSSL_ROOT_DIR /usr/local/opt/openssl) endif() +if(NOT MSVC AND NOT APPLE) + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads REQUIRED) +endif() + # # LMDB # @@ -72,7 +77,20 @@ set(CMAKE_C_COMPILER gcc) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) -include(CompilerFlags) +if(NOT MSVC) + set( + CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} \ + -Wall \ + -Wextra \ + -Werror \ + -pipe \ + -pedantic \ + -fsized-deallocation \ + -fdiagnostics-color=always \ + -Wunreachable-code" + ) +endif() if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING @@ -187,10 +205,10 @@ set(SRC_FILES # ExternalProject dependencies set(EXTERNAL_PROJECT_DEPS "") +find_package(ZLIB REQUIRED) +find_package(OpenSSL REQUIRED) find_package(MatrixStructs REQUIRED) find_package(MatrixClient REQUIRED) -find_package(OpenSSL REQUIRED) -find_package(ZLIB REQUIRED) # # tweeny diff --git a/appveyor.yml b/appveyor.yml index 0cd819ab..c9f3023e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,6 +14,8 @@ build: install: - set QT_DIR=C:\Qt\5.10.1\msvc2017_64 - set PATH=%PATH%;%QT_DIR%\bin;C:\MinGW\bin + - set PATH=%PATH%;C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin + - mingw32-make.exe --version - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" - vcpkg install boost-asio:%PLATFORM%-windows diff --git a/cmake/CompilerFlags.cmake b/cmake/CompilerFlags.cmake deleted file mode 100644 index f5860a99..00000000 --- a/cmake/CompilerFlags.cmake +++ /dev/null @@ -1,26 +0,0 @@ -if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \ - -Wall \ - -Wextra \ - -Werror \ - -pipe \ - -Wno-unused-function \ - -pedantic \ - -Wunreachable-code") - - if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") - execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) - - if (GCC_VERSION VERSION_GREATER 4.9) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always" ) - endif() - endif() - - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always" ) - endif() -endif() - -if(NOT APPLE AND NOT MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") -endif() diff --git a/deps/cmake/Olm.cmake b/deps/cmake/Olm.cmake index b0df2833..0eb44d37 100644 --- a/deps/cmake/Olm.cmake +++ b/deps/cmake/Olm.cmake @@ -4,8 +4,6 @@ else() set(MAKE_CMD "make") endif() -set(OLM_NAME "${CMAKE_STATIC_LIBRARY_PREFIX}olm${CMAKE_STATIC_LIBRARY_SUFFIX}") - ExternalProject_Add( Olm |