Makes windows build possible.

This commit is contained in:
Felix Queißner 2020-06-30 10:19:26 -07:00
parent 16a4956a29
commit ef6e2f513c
7 changed files with 83 additions and 3 deletions

6
ci/.gitignore vendored
View File

@ -1,2 +1,4 @@
build/
output/
build/
output/
kristall/
kristall-nightly.zip

BIN
ci/7z/7za.dll Normal file

Binary file not shown.

BIN
ci/7z/7za.exe Normal file

Binary file not shown.

BIN
ci/7z/7zxa.dll Normal file

Binary file not shown.

31
ci/7z/License.txt Normal file
View File

@ -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/

39
ci/build-and-deploy.bat Normal file
View File

@ -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

View File

@ -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 {