Update CI instructions

This commit is contained in:
Konstantinos Sideris 2018-06-17 00:23:49 +03:00
parent 24e0285210
commit c0d32ef319
9 changed files with 40 additions and 32 deletions

View file

@ -11,7 +11,6 @@ if [ $TRAVIS_OS_NAME == osx ]; then
fi fi
# Build & install dependencies # Build & install dependencies
mkdir -p .deps/usr/{lib,include}/
cmake -Hdeps -B.deps \ cmake -Hdeps -B.deps \
-DUSE_BUNDLED_BOOST=${USE_BUNDLED_BOOST} \ -DUSE_BUNDLED_BOOST=${USE_BUNDLED_BOOST} \
-DUSE_BUNDLED_SPDLOG=${USE_BUNDLED_SPDLOG} -DUSE_BUNDLED_SPDLOG=${USE_BUNDLED_SPDLOG}

View file

@ -29,12 +29,6 @@ set(IDENTIFIER "com.github.mujx.nheko")
add_project_meta(META_FILES_TO_INCLUDE) add_project_meta(META_FILES_TO_INCLUDE)
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr"
CACHE PATH "Path prefix for finding dependencies")
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
include_directories(SYSTEM ${DEPS_PREFIX}/include)
if(APPLE) if(APPLE)
set(OPENSSL_ROOT_DIR /usr/local/opt/openssl) set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)
endif() endif()
@ -208,8 +202,10 @@ set(EXTERNAL_PROJECT_DEPS "")
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
find_package(OpenSSL REQUIRED) find_package(OpenSSL REQUIRED)
find_package(MatrixStructs REQUIRED) find_package(MatrixStructs 0.1.0 REQUIRED)
find_package(MatrixClient REQUIRED) find_package(MatrixClient 0.1.0 REQUIRED)
find_package(Olm 2 REQUIRED)
find_package(spdlog 0.16.0 CONFIG REQUIRED)
# #
# tweeny # tweeny
@ -315,7 +311,8 @@ set(COMMON_LIBS
MatrixClient::MatrixClient MatrixClient::MatrixClient
Qt5::Widgets Qt5::Widgets
Qt5::Svg Qt5::Svg
Qt5::Concurrent) Qt5::Concurrent
Qt5::Multimedia)
if(APPVEYOR_BUILD) if(APPVEYOR_BUILD)
set(NHEKO_LIBS ${COMMON_LIBS} lmdb) set(NHEKO_LIBS ${COMMON_LIBS} lmdb)
@ -345,13 +342,13 @@ endif()
if(APPLE) if(APPLE)
add_executable (nheko ${OS_BUNDLE} ${NHEKO_DEPS}) add_executable (nheko ${OS_BUNDLE} ${NHEKO_DEPS})
target_link_libraries (nheko ${NHEKO_LIBS} Qt5::MacExtras Qt5::Multimedia) target_link_libraries (nheko ${NHEKO_LIBS} Qt5::MacExtras)
elseif(WIN32) elseif(WIN32)
add_executable (nheko ${OS_BUNDLE} ${ICON_FILE} ${NHEKO_DEPS}) add_executable (nheko ${OS_BUNDLE} ${ICON_FILE} ${NHEKO_DEPS})
target_link_libraries (nheko ${NTDLIB} ${NHEKO_LIBS} Qt5::WinMain Qt5::Multimedia) target_link_libraries (nheko ${NTDLIB} ${NHEKO_LIBS} Qt5::WinMain)
else() else()
add_executable (nheko ${OS_BUNDLE} ${NHEKO_DEPS}) add_executable (nheko ${OS_BUNDLE} ${NHEKO_DEPS})
target_link_libraries (nheko ${NHEKO_LIBS} Qt5::Multimedia) target_link_libraries (nheko ${NHEKO_LIBS})
endif() endif()
if(EXTERNAL_PROJECT_DEPS) if(EXTERNAL_PROJECT_DEPS)

View file

@ -2,25 +2,30 @@ DEPS_BUILD_DIR=.deps
DEPS_SOURCE_DIR=deps DEPS_SOURCE_DIR=deps
debug: debug:
@cmake -H. -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 @cmake -H. -GNinja \
-Bbuild \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
-DCMAKE_INSTALL_PREFIX=${DEPS_BUILD_DIR}/usr
@cmake --build build @cmake --build build
third_party: third-party:
@mkdir -p ${DEPS_BUILD_DIR}/usr/{lib,include}/
@cmake -GNinja -H${DEPS_SOURCE_DIR} -B${DEPS_BUILD_DIR} \ @cmake -GNinja -H${DEPS_SOURCE_DIR} -B${DEPS_BUILD_DIR} \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DUSE_BUNDLED_BOOST=OFF -DUSE_BUNDLED_BOOST=OFF
@cmake --build ${DEPS_BUILD_DIR} @cmake --build ${DEPS_BUILD_DIR}
ci: ci:
mkdir -p ${DEPS_BUILD_DIR}/usr/{lib,include}/
cmake -H${DEPS_SOURCE_DIR} -B${DEPS_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release cmake -H${DEPS_SOURCE_DIR} -B${DEPS_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release
cmake --build ${DEPS_BUILD_DIR} cmake --build ${DEPS_BUILD_DIR}
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build cmake --build build
release: release:
@cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo @cmake -H. -GNinja \
-Bbuild \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${DEPS_BUILD_DIR}/usr
@cmake --build build @cmake --build build
linux-install: linux-install:

View file

@ -15,7 +15,6 @@ install:
- set QT_DIR=C:\Qt\5.10.1\msvc2017_64 - set QT_DIR=C:\Qt\5.10.1\msvc2017_64
- set PATH=%PATH%;%QT_DIR%\bin;C:\MinGW\bin - 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 - 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" - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
- vcpkg install - vcpkg install
boost-asio:%PLATFORM%-windows boost-asio:%PLATFORM%-windows
@ -28,7 +27,6 @@ install:
libsodium:%PLATFORM%-windows libsodium:%PLATFORM%-windows
lmdb:%PLATFORM%-windows lmdb:%PLATFORM%-windows
openssl:%PLATFORM%-windows openssl:%PLATFORM%-windows
spdlog:%PLATFORM%-windows
zlib:%PLATFORM%-windows zlib:%PLATFORM%-windows
build_script: build_script:
@ -53,16 +51,12 @@ build_script:
# Build & install the dependencies # Build & install the dependencies
- cmake -G "Visual Studio 15 2017 Win64" -Hdeps -B.deps - cmake -G "Visual Studio 15 2017 Win64" -Hdeps -B.deps
-DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake
-DCMAKE_BUILD_TYPE=Release
-DUSE_BUNDLED_BOOST=OFF -DUSE_BUNDLED_BOOST=OFF
-DUSE_BUNDLED_SPDLOG=OFF
-DUSE_BUNDLED_GTEST=OFF
- cmake --build .deps --config Release - cmake --build .deps --config Release
# Build nheko # Build nheko
- cmake -G "Visual Studio 15 2017 Win64" -H. -Bbuild - cmake -G "Visual Studio 15 2017 Win64" -H. -Bbuild
-DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake
-DCMAKE_BUILD_TYPE=Release
- cmake --build build --config Release - cmake --build build --config Release
after_build: after_build:

2
deps/CMakeLists.txt vendored
View file

@ -40,7 +40,7 @@ set(MATRIX_STRUCTS_URL https://github.com/mujx/matrix-structs)
set(MATRIX_STRUCTS_TAG eeb7373729a1618e2b3838407863342b88b8a0de) set(MATRIX_STRUCTS_TAG eeb7373729a1618e2b3838407863342b88b8a0de)
set(MTXCLIENT_URL https://github.com/mujx/mtxclient) set(MTXCLIENT_URL https://github.com/mujx/mtxclient)
set(MTXCLIENT_TAG c566fa0a254dce3282435723eb58590880be2b53) set(MTXCLIENT_TAG e45b1c85fce52f8ed516fd98a9cbb6a110a20d09)
set(OLM_URL https://git.matrix.org/git/olm.git) set(OLM_URL https://git.matrix.org/git/olm.git)
set(OLM_TAG 4065c8e11a33ba41133a086ed3de4da94dcb6bae) set(OLM_TAG 4065c8e11a33ba41133a086ed3de4da94dcb6bae)

View file

@ -1,3 +1,9 @@
set(WINDOWS_FLAGS "")
if(MSVC)
set(WINDOWS_FLAGS "-DCMAKE_GENERATOR_PLATFORM=x64")
endif()
ExternalProject_Add( ExternalProject_Add(
Olm Olm
@ -16,11 +22,13 @@ ExternalProject_Add(
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR} -DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
-DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_TYPE=Release
${DEPS_BUILD_DIR}/olm ${DEPS_BUILD_DIR}/olm
${WINDOWS_FLAGS}
BUILD_COMMAND ${CMAKE_COMMAND} BUILD_COMMAND ${CMAKE_COMMAND}
--build ${DEPS_BUILD_DIR}/olm --build ${DEPS_BUILD_DIR}/olm
--config Release --config Release
INSTALL_COMMAND ${CMAKE_COMMAND} INSTALL_COMMAND ${CMAKE_COMMAND}
--build ${DEPS_BUILD_DIR}/olm --build ${DEPS_BUILD_DIR}/olm
--config Release
--target install) --target install)
list(APPEND THIRD_PARTY_DEPS Olm) list(APPEND THIRD_PARTY_DEPS Olm)

View file

@ -4,8 +4,8 @@ include(CMakeFindDependencyMacro)
list(APPEND CMAKE_MODULE_PATH ${Olm_CMAKE_DIR}) list(APPEND CMAKE_MODULE_PATH ${Olm_CMAKE_DIR})
list(REMOVE_AT CMAKE_MODULE_PATH -1) list(REMOVE_AT CMAKE_MODULE_PATH -1)
if(NOT TARGET Olm::olm) if(NOT TARGET Olm::Olm)
include("${Olm_CMAKE_DIR}/OlmTargets.cmake") include("${Olm_CMAKE_DIR}/OlmTargets.cmake")
endif() endif()
set(Olm_LIBRARIES Olm::olm) set(Olm_LIBRARIES Olm::Olm)

View file

@ -1,3 +1,9 @@
set(WINDOWS_FLAGS "")
if(MSVC)
set(WINDOWS_FLAGS "-DCMAKE_GENERATOR_PLATFORM=x64")
endif()
ExternalProject_Add( ExternalProject_Add(
SpdLog SpdLog
@ -10,8 +16,7 @@ ExternalProject_Add(
-DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR} -DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
-DSPDLOG_BUILD_EXAMPLES=0 -DSPDLOG_BUILD_EXAMPLES=0
-DSPDLOG_BUILD_TESTING=0 -DSPDLOG_BUILD_TESTING=0
-DCMAKE_BUILD_TYPE=Release
${DEPS_BUILD_DIR}/spdlog ${DEPS_BUILD_DIR}/spdlog
) ${WINDOWS_FLAGS})
list(APPEND THIRD_PARTY_DEPS SpdLog) list(APPEND THIRD_PARTY_DEPS SpdLog)

View file

@ -31,8 +31,8 @@
using namespace dialogs; using namespace dialogs;
static constexpr const char *DEFAULT = "Upload %1?"; constexpr const char *DEFAULT = "Upload %1?";
static constexpr const char *ERROR = "Failed to load image type '%1'. Continue upload?"; constexpr const char *ERR_MSG = "Failed to load image type '%1'. Continue upload?";
PreviewUploadOverlay::PreviewUploadOverlay(QWidget *parent) PreviewUploadOverlay::PreviewUploadOverlay(QWidget *parent)
: QWidget{parent} : QWidget{parent}
@ -105,7 +105,7 @@ PreviewUploadOverlay::setLabels(const QString &type, const QString &mime, uint64
{ {
if (mediaType_ == "image") { if (mediaType_ == "image") {
if (!image_.loadFromData(data_)) { if (!image_.loadFromData(data_)) {
titleLabel_.setText(QString{tr(ERROR)}.arg(type)); titleLabel_.setText(QString{tr(ERR_MSG)}.arg(type));
} else { } else {
titleLabel_.setText(QString{tr(DEFAULT)}.arg(mediaType_)); titleLabel_.setText(QString{tr(DEFAULT)}.arg(mediaType_));
} }