Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suppress protobuf warnings in unix builds
The protobuf code creates lots of spurious warnings throughout our compile which we can do nothing about. This patch changes the way we integrate the generated code in our build to work around this. We now run protoc and generated code compilation as a seperate mumble_proto target producing a static lib. This lib is then linked by mumble and murmur. The folder of this module is added to the include paths so Mumble.pb.h is available. On Unix platforms a -isystem entry is added for the directory. The advantages of this approach is that we can disable warnings for the compilation of this target like we do for 3rd party modules. Additionally we no longer generate and compile the protobuf files twice.
- Loading branch information
Showing
4 changed files
with
56 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
include(../../compiler.pri) | ||
|
||
PROTOBUF *= ../Mumble.proto | ||
|
||
pbh.output = ${QMAKE_FILE_BASE}.pb.h | ||
pbh.depends = ${QMAKE_FILE_BASE}.pb.cc | ||
pbh.commands = $$escape_expand(\\n) | ||
pbh.input = PROTOBUF | ||
pbh.CONFIG *= no_link explicit_dependencies target_predeps | ||
pbh.variable_out = HEADERS | ||
|
||
pb.output = ${QMAKE_FILE_BASE}.pb.cc | ||
pb.commands = protoc --cpp_out=. -I. -I.. ${QMAKE_FILE_NAME} | ||
pb.input = PROTOBUF | ||
pb.CONFIG *= no_link explicit_dependencies | ||
pb.variable_out = SOURCES | ||
|
||
TEMPLATE = lib | ||
CONFIG -= qt | ||
CONFIG += debug_and_release | ||
CONFIG += staticlib | ||
|
||
INCLUDEPATH *= "$$PROTOBUF_PATH/vsprojects/include" "$$PROTOBUF_PATH/src" protobuf | ||
|
||
QMAKE_EXTRA_COMPILERS *= pb pbh | ||
|
||
!CONFIG(third-party-warnings) { | ||
# We ignore warnings in third party builds. We won't actually look | ||
# at them and they clutter out our warnings. | ||
CONFIG -= warn_on | ||
CONFIG += warn_off | ||
} | ||
|
||
CONFIG(debug, debug|release) { | ||
DESTDIR = ../../debug | ||
} | ||
|
||
CONFIG(release, debug|release) { | ||
DESTDIR = ../../release | ||
} | ||
|
||
include(../../symbols.pri) | ||
|