Skip to content

Commit

Permalink
Continuous Integration - add option -Werror to detect new compiler wa…
Browse files Browse the repository at this point in the history
…rnings when using Travis CI

when targeting Android, Linux and macOS.
  • Loading branch information
gkv311 committed Jan 12, 2019
1 parent 94a642e commit e7e9509
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
6 changes: 6 additions & 0 deletions Makefile
Expand Up @@ -215,6 +215,12 @@ ifeq ($(TARGET_OS),linux)
EXTRA_CXXFLAGS += `pkg-config gtk+-2.0 --cflags`
endif

# optionally fail on any compiler warning except #warning and deprecations
WERROR_LEVEL = 0
ifeq ($(WERROR_LEVEL),1)
EXTRA_CXXFLAGS += -Werror -Wno-error=cpp -Wno-error=deprecated-declarations
endif

INC = -I$(SRCDIR)/3rdparty/include -I$(SRCDIR)/include
CFLAGS = -fPIC $(HAVE_MONGOOSE) $(INC) $(EXTRA_CFLAGS)
CXXFLAGS = -O3 -std=c++0x -Wall -fPIC $(HAVE_MONGOOSE) $(INC) $(EXTRA_CXXFLAGS)
Expand Down
2 changes: 2 additions & 0 deletions StMoviePlayer/StVideo/StAudioQueue.cpp
Expand Up @@ -923,6 +923,8 @@ bool StAudioQueue::stalQueue(const double thePts) {
);
}
myDbgPrevQueued = aQueued;
#else
(void )myDbgPrevQueued;
#endif

if((aState == AL_PLAYING
Expand Down
8 changes: 6 additions & 2 deletions StShared/StWebPImage.cpp
Expand Up @@ -28,6 +28,7 @@ extern "C" {
VP8_STATUS_NOT_ENOUGH_DATA
} VP8StatusCode;

#ifdef ST_HAVE_WEBP
static const char* const WebPStatusMessages[] = {
"OK", // VP8_STATUS_OK
"OUT_OF_MEMORY", // VP8_STATUS_OUT_OF_MEMORY
Expand All @@ -38,6 +39,7 @@ extern "C" {
"USER_ABORT", // VP8_STATUS_USER_ABORT
"NOT_ENOUGH_DATA" // VP8_STATUS_NOT_ENOUGH_DATA
};
#endif

extern int WebPInitDecoderConfigInternal(StWebPImage::WebPDecoderConfig* theConfig, int theVersion);

Expand Down Expand Up @@ -70,8 +72,7 @@ bool StWebPImage::init() {
}

StWebPImage::StWebPImage()
: StImageFile(),
myIsCompat(false) {
: myIsCompat(false) {
#ifdef ST_HAVE_WEBP
myIsCompat = WebPInitDecoderConfig(&myConfig) != 0;
#endif
Expand All @@ -86,6 +87,9 @@ void StWebPImage::close() {
if(myIsCompat) {
WebPFreeDecBuffer(&myConfig.output);
}
#else
(void )myConfig;
(void )myIsCompat;
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion contentiousIntegration/build_sview_android.sh
Expand Up @@ -22,4 +22,4 @@ aNbJobs="$(getconf _NPROCESSORS_ONLN)"
# perform building itself
make --directory=$aScriptPath/.. clean
make --directory=$aScriptPath/.. -j $aNbJobs android ANDROID_NDK=$SVIEW_NDK ANDROID_BUILD_TOOLS=$SVIEW_BUILD_TOOLS ANDROID_PLATFORM=$SVIEW_PLATFORM \
FFMPEG_ROOT=$SVIEW_FFMPEG FREETYPE_ROOT=$SVIEW_FREETYPE OPENAL_ROOT=$SVIEW_OPENAL LIBCONFIG_ROOT=$SVIEW_LIBCONFIG
FFMPEG_ROOT=$SVIEW_FFMPEG FREETYPE_ROOT=$SVIEW_FREETYPE OPENAL_ROOT=$SVIEW_OPENAL LIBCONFIG_ROOT=$SVIEW_LIBCONFIG WERROR_LEVEL=1
2 changes: 1 addition & 1 deletion contentiousIntegration/build_sview_linux.sh
Expand Up @@ -10,4 +10,4 @@ aNbJobs="$(getconf _NPROCESSORS_ONLN)"

# perform building itself
make --directory=$aScriptPath/.. clean
make --directory=$aScriptPath/.. -j $aNbJobs
make --directory=$aScriptPath/.. -j $aNbJobs WERROR_LEVEL=1
2 changes: 1 addition & 1 deletion contentiousIntegration/build_sview_osx.sh
Expand Up @@ -10,4 +10,4 @@ aNbJobs="$(getconf _NPROCESSORS_ONLN)"

# perform building itself
make --directory=$aScriptPath/.. clean
make --directory=$aScriptPath/.. -j $aNbJobs
make --directory=$aScriptPath/.. -j $aNbJobs WERROR_LEVEL=1

0 comments on commit e7e9509

Please sign in to comment.