From ef6e2f513cde84fcd86795259830df364d5994b2 Mon Sep 17 00:00:00 2001 From: Felix Queißner Date: Tue, 30 Jun 2020 10:19:26 -0700 Subject: Makes windows build possible. --- ci/.gitignore | 6 ++++-- ci/7z/7za.dll | Bin 0 -> 381952 bytes ci/7z/7za.exe | Bin 0 -> 1152000 bytes ci/7z/7zxa.dll | Bin 0 -> 209408 bytes ci/7z/License.txt | 31 +++++++++++++++++++++++++++++++ ci/build-and-deploy.bat | 39 +++++++++++++++++++++++++++++++++++++++ src/kristall.pro | 10 +++++++++- 7 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 ci/7z/7za.dll create mode 100644 ci/7z/7za.exe create mode 100644 ci/7z/7zxa.dll create mode 100644 ci/7z/License.txt create mode 100644 ci/build-and-deploy.bat diff --git a/ci/.gitignore b/ci/.gitignore index b97a986..17c6c2d 100644 --- a/ci/.gitignore +++ b/ci/.gitignore @@ -1,2 +1,4 @@ -build/ -output/ +build/ +output/ +kristall/ +kristall-nightly.zip \ No newline at end of file diff --git a/ci/7z/7za.dll b/ci/7z/7za.dll new file mode 100644 index 0000000..bc2b47a Binary files /dev/null and b/ci/7z/7za.dll differ diff --git a/ci/7z/7za.exe b/ci/7z/7za.exe new file mode 100644 index 0000000..9f27b20 Binary files /dev/null and b/ci/7z/7za.exe differ diff --git a/ci/7z/7zxa.dll b/ci/7z/7zxa.dll new file mode 100644 index 0000000..d51e3f0 Binary files /dev/null and b/ci/7z/7zxa.dll differ diff --git a/ci/7z/License.txt b/ci/7z/License.txt new file mode 100644 index 0000000..e5d33d7 --- /dev/null +++ b/ci/7z/License.txt @@ -0,0 +1,31 @@ + 7-Zip Extra + ~~~~~~~~~~~ + License for use and distribution + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Copyright (C) 1999-2019 Igor Pavlov. + + 7-Zip Extra files are under the GNU LGPL license. + + + Notes: + You can use 7-Zip Extra on any computer, including a computer in a commercial + organization. You don't need to register or pay for 7-Zip. + + + GNU LGPL information + -------------------- + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You can receive a copy of the GNU Lesser General Public License from + http://www.gnu.org/ + diff --git a/ci/build-and-deploy.bat b/ci/build-and-deploy.bat new file mode 100644 index 0000000..40825fe --- /dev/null +++ b/ci/build-and-deploy.bat @@ -0,0 +1,39 @@ +@ECHO OFF + +REM This script builds Kristall for windows and creates a deployment + +SET "DEPLOY=%CD%\kristall" +SET "ROOT=%CD%" +CALL "C:\Qt\5.15.0\mingw81_64\bin\qtenv2.bat" +CD /D "%ROOT%" + +IF NOT EXIST build MKDIR build || GOTO ERR +CD build || GOTO ERR + +ECHO Compiling... +qmake ..\..\src\kristall.pro || GOTO ERR +mingw32-make || GOTO ERR +cd .. + +RMDIR /S /Q "%DEPLOY%" || GOTO ERR +MKDIR "%DEPLOY%" || GOTO ERR + +ECHO Deployment... +COPY build\release\kristall.exe "%DEPLOY%\kristall.exe" || GOTO ERR +COPY "C:\Qt\Tools\OpenSSL\Win_x64\bin\libcrypto-1_1-x64.dll" "%DEPLOY%\libcrypto-1_1-x64.dll" || GOTO ERR +COPY "C:\Qt\Tools\OpenSSL\Win_x64\bin\libssl-1_1-x64.dll" "%DEPLOY%\libssl-1_1-x64.dll" || GOTO ERR + +windeployqt %DEPLOY%\kristall.exe || GOTO ERR + +CD "%ROOT% || GOTO ERR + +ECHO Creating package... +DEL /Q kristall-nightly.zip || GOTO ERR +.\7z\7za.exe a kristall-nightly.zip %DEPLOY% || GOTO ERR + +EXIT /B 0 + +:ERR +ECHO There was a error building kristall! +PAUSE +EXIT /B 1 \ No newline at end of file diff --git a/src/kristall.pro b/src/kristall.pro index d860340..917c212 100644 --- a/src/kristall.pro +++ b/src/kristall.pro @@ -16,7 +16,7 @@ DEFINES += KRISTALL_VERSION="\"$(shell cd $$PWD; git describe --tags)\"" # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 -LIBS += -lcrypto +!win32: LIBS += -lcrypto # We need iconv on non-linux platforms !linux: LIBS += -liconv @@ -29,6 +29,7 @@ QMAKE_CXXFLAGS += -std=c++17 CONFIG += c++17 win32-msvc { + # message("Use windows/msvc build") QMAKE_CFLAGS -= -Wno-unused-parameter QMAKE_CXXFLAGS -= -Wno-unused-parameter @@ -39,6 +40,13 @@ win32-msvc { INCLUDEPATH += "C:\Program Files\OpenSSL\include" } +win32-g++ { + # message("Use windows/mingw build") + INCLUDEPATH += $$quote("C:\Qt\Tools\OpenSSL\Win_x64\include") + LIBS += -L$$quote(C:\Qt\Tools\OpenSSL\Win_x64\lib) + LIBS += -llibcrypto +} + android: include(/home/felix/projects/android-hass/android-sdk/android_openssl/openssl.pri) # android { -- cgit v1.2.3