Skip to content

Commit

Permalink
build/windows: fail loud and hard (#188)
Browse files Browse the repository at this point in the history
* build/windows: fail load and hard

* qmake: fixup broken debug|release queries

* qmake: fixup library paths for Windows
  • Loading branch information
machinekoder authored Aug 9, 2017
1 parent aae735f commit 18f2529
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 46 deletions.
4 changes: 2 additions & 2 deletions 3rdparty/machinetalk-protobuf-qt/machinetalk-protobuf-lib.pri
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ INCLUDEPATH += $$MACHINETALK_PATH/build/cpp
!win32 {
LIBS += -L$$MACHINETALK_PATH
} else {
CONFIG(debug, release): LIBS += -L$$MACHINETALK_PATH/release
CONFIG(debug, debug): LIBS += -L$$MACHINETALK_PATH/debug
CONFIG(release, debug|release): LIBS += -L$$MACHINETALK_PATH/release
CONFIG(debug, debug|release): LIBS += -L$$MACHINETALK_PATH/debug
!isEmpty(PROTOBUF_LIB_PATH): LIBS += -L$$PROTOBUF_LIB_PATH
!isEmpty(PROTOBUF_LIB_FLAGS): LIBS += $$PROTOBUF_LIB_FLAGS
LIBS += -llibprotobuf
Expand Down
7 changes: 5 additions & 2 deletions 3rdparty/machinetalk-protobuf-qt/machinetalk-protobuf-qt.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ macx | win32: {
CONFIG += static
}

linux-g++: {
# disable warnings
# disable compiler warnings
*-g++: {
QMAKE_CXXFLAGS += -w
}
win32-msvc*: {
QMAKE_CXXFLAGS += /W0
}

TARGET = machinetalk-pb2
TEMPLATE = lib
Expand Down
9 changes: 8 additions & 1 deletion QtQuickVcp.pro
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,18 @@ SUBDIRS += 3rdparty src apps # examples
src.depends = 3rdparty
apps.depends = src

debug: CONFIG(debug, debug|release) {
CONFIG(debug, debug|release) {
SUBDIRS += tests
tests.depends = src
}

include(qtquickvcp_version.pri)
include(paths.pri)
include(doc/doc.pri)

CONFIG(debug, debug|release) {
message("running in DEBUG mode")
}
else {
message("running in RELEASE mode")
}
64 changes: 32 additions & 32 deletions build/appveyor/appveyor.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ cd tmp

:: get version label
appveyor DownloadFile http://ci.roessler.systems/files/qt-bin/UnxUtils.zip -Filename UnxUtils.zip
7z x UnxUtils.zip
cp usr\local\wbin\date.exe .
7z x UnxUtils.zip || goto :error
cp usr\local\wbin\date.exe . || goto :error

cd ..

Expand All @@ -32,54 +32,54 @@ if %release% == 0 (
if %release% == 0 (
set version=%datetime%-%branch%-%revision%
)
echo #define REVISION "%version%" > src\application\revision.h
appveyor UpdateBuild -Version "%version%-%ARCH%"
echo #define REVISION "%version%" > src\application\revision.h || goto :error
appveyor UpdateBuild -Version "%version%-%ARCH%" || goto :error


cd tmp
appveyor DownloadFile http://ci.roessler.systems/files/qt-bin/protobuf-win-%ARCH%.7z -Filename protolibs.7z
7z x protolibs.7z
appveyor DownloadFile http://ci.roessler.systems/files/qt-bin/protobuf-win-%ARCH%.7z -Filename protolibs.7z || goto :error
7z x protolibs.7z || goto :error
cd protolibs
if %ARCH% == x64 (
SET PROTODIR=%HOMEDRIVE%%HOMEPATH%\bin\protobuf\vsprojects\x64\Release
) else (
SET PROTODIR=%HOMEDRIVE%%HOMEPATH%\bin\protobuf\vsprojects\Release
)
mkdir -p %PROTODIR%
mv protoc.exe %PROTODIR%\
mv libprotoc.lib %PROTODIR%\
cp libprotobuf.lib %PROTODIR%\
mv libprotobuf.lib %QTDIR%\lib\
mv protoc.exe %PROTODIR%\ || goto :error
mv libprotoc.lib %PROTODIR%\ || goto :error
cp libprotobuf.lib %PROTODIR%\ || goto :error
mv libprotobuf.lib %QTDIR%\lib\ || goto :error
cd ..

SET PROTOVERSION=2.6.1
appveyor DownloadFile https://github.com/google/protobuf/archive/v%PROTOVERSION%.zip -Filename protosrc.zip
7z x protosrc.zip
cd protobuf-%PROTOVERSION%
7z x protosrc.zip || goto :error
cd protobuf-%PROTOVERSION% || goto :error
SET PROTODIR=%HOMEDRIVE%%HOMEPATH%\bin\protobuf\
cp -r src %PROTODIR%
cd ..
cp -r src %PROTODIR% || goto :error
cd .. || goto :error

appveyor DownloadFile http://ci.roessler.systems/files/qt-bin/zeromq-win-%ARCH%.7z -Filename zmqlibs.7z
7z x zmqlibs.7z
appveyor DownloadFile http://ci.roessler.systems/files/qt-bin/zeromq-win-%ARCH%.7z -Filename zmqlibs.7z || goto :error
7z x zmqlibs.7z || goto :error
cd zmqlibs
if %ARCH% == x64 (
SET ZEROMQDIR=%HOMEDRIVE%%HOMEPATH%\bin\zeromq4-x\lib\x64
) else (
SET ZEROMQDIR=%HOMEDRIVE%%HOMEPATH%\bin\zeromq4-x\lib\Win32
)
mkdir -p %ZEROMQDIR%
cp libzmq.lib %ZEROMQDIR%\
mv libzmq.lib %QTDIR%\lib\
mv libzmq.dll %QTDIR%\bin\
cp libzmq.lib %ZEROMQDIR%\ || goto :error
mv libzmq.lib %QTDIR%\lib\ || goto :error
mv libzmq.dll %QTDIR%\bin\ || goto :error
cd ..

SET ZMQVERSION=4.0.8
appveyor DownloadFile https://github.com/zeromq/zeromq4-x/archive/v%ZMQVERSION%.zip -Filename zmqsrc.zip
7z x zmqsrc.zip
appveyor DownloadFile https://github.com/zeromq/zeromq4-x/archive/v%ZMQVERSION%.zip -Filename zmqsrc.zip || goto :error
7z x zmqsrc.zip || goto :error
cd zeromq4-x-%ZMQVERSION%
SET ZEROMQDIR=%HOMEDRIVE%%HOMEPATH%\bin\zeromq4-x
cp -r include %ZEROMQDIR%
cp -r include %ZEROMQDIR% || goto :error
cd ..

:: start build
Expand All @@ -92,17 +92,17 @@ nmake install || goto :error

mkdir MachinekitClient
cd MachinekitClient
cp ../apps/MachinekitClient/release/machinekit-client.exe .
windeployqt --angle --release --qmldir ../../apps/MachinekitClient/ machinekit-client.exe
cp %QTDIR%\bin\libzmq.dll .
cd ..
7z a MachinekitClient.zip MachinekitClient/
cp ../apps/MachinekitClient/release/machinekit-client.exe . || goto :error
windeployqt --angle --release --qmldir ../../apps/MachinekitClient/ machinekit-client.exe || goto :error
cp %QTDIR%\bin\libzmq.dll . || goto :error
cd .. || goto :error
7z a MachinekitClient.zip MachinekitClient/ || goto :error

mkdir qml
mkdir lib
cp -r %QTDIR%/qml/Machinekit qml/
cp -r %QTDIR%/bin/libzmq.dll lib/
7z a QtQuickVcp.zip qml/ lib/
cp -r %QTDIR%/qml/Machinekit qml/ || goto :error
cp -r %QTDIR%/bin/libzmq.dll lib/ || goto :error
7z a QtQuickVcp.zip qml/ lib/ || goto :error

:: rename deployment files
set platform=%ARCH%
Expand All @@ -114,8 +114,8 @@ if %release% == 0 (
set target2="MachinekitClient"
)

mv QtQuickVcp.zip %target1%-%version%-Windows-%platform%.zip
mv MachinekitClient.zip %target2%-%version%-%platform%.zip
mv QtQuickVcp.zip %target1%-%version%-Windows-%platform%.zip || goto :error
mv MachinekitClient.zip %target2%-%version%-%platform%.zip || goto :error

goto :EOF

Expand Down
6 changes: 3 additions & 3 deletions paths.pri
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ macx: {
PROTOBUF_PROTOC = /opt/local/bin/protoc
PROTOBUF_LIB_FLAGS = -Bstatic
}
win32-msvc2013 | win32-msvc2015 | win32-msvc2017: {
CONFIG(debug, debug): PROTOBUF_DEBUG = Debug
CONFIG(debug, release): PROTOBUF_DEBUG = Release
win32-msvc*: {
CONFIG(debug, debug|release): PROTOBUF_DEBUG = Debug
CONFIG(release, debug|release): PROTOBUF_DEBUG = Release

PROTOBUF_INCLUDE_PATH = $$(HOMEDRIVE)$$(HOMEPATH)/bin/protobuf/src
ZEROMQ_INCLUDE_PATH = $$(HOMEDRIVE)$$(HOMEPATH)/bin/zeromq4-x/include
Expand Down
2 changes: 1 addition & 1 deletion src/deployment.pri
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ QMAKE_CLEAN += $$OUT_PWD/../../imports/$$TARGETPATH/

# ========== install additional files ==========
isEmpty(QMLPLUGINDUMP): QMLPLUGINDUMP = 1
equals(QMLPLUGINDUMP, 1): !ios: !android: CONFIG(debug, release): {
equals(QMLPLUGINDUMP, 1): !ios: !android: CONFIG(release, debug|release): {
dumppluginqmltypes.CONFIG = no_files no_path
dumppluginqmltypes.commands = $$dirname(QMAKE_QMAKE)/qmlplugindump -nonrelocatable "$$uri $$PLUGIN_VERSION $$shell_path($$OUT_PWD/../../imports/) > $$shell_path($$OUT_PWD/../../imports/$$TARGETPATH/plugins.qmltypes)"
INSTALLS += dumppluginqmltypes
Expand Down
6 changes: 3 additions & 3 deletions src/machinetalk/machinetalk.pri
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ INCLUDEPATH += $$PWD

!win32 {
LIBS += -L$$MACHINETALK_PATH
LIBS += -Bstatic
} else {
LIBS += -L$$MACHINETALK_PATH/release
LIBS += -L$$MACHINETALK_PATH/debug
CONFIG(release, debug|release): LIBS += -L$$MACHINETALK_PATH/release
CONFIG(debug, debug|release): LIBS += -L$$MACHINETALK_PATH/debug
}
LIBS += -Bstatic
LIBS += -lmachinetalk
2 changes: 0 additions & 2 deletions src/protobuf.pri
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ isEmpty(PROTOGEN): PROTOGEN = generated
PROTOPATHS =
for(p, PROTOPATH):PROTOPATHS += --proto_path=$$shell_path($$relative_path($${p}, $$OUT_PWD))

message("Generating protocol buffer classes from .proto files.")

protobuf_decl.name = protobuf headers
protobuf_decl.input = PROTOS
protobuf_decl.output = $$OUT_PWD/$$PROTOGEN/$$NAMESPACE_DIR/${QMAKE_FILE_BASE}.pb.h
Expand Down

0 comments on commit 18f2529

Please sign in to comment.