can now configure build such that runtime warnings and/or errors occuring in lib are not printed to stderr (thanks Nigel Steward)
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1501 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
f79dae9865
commit
17a8372217
@ -25,6 +25,12 @@ set(VERSION_PATCH 0)
|
|||||||
OPTION(BUILD_SHARED_LIBS "Build FreeGLUT shared library." ON)
|
OPTION(BUILD_SHARED_LIBS "Build FreeGLUT shared library." ON)
|
||||||
OPTION(BUILD_STATIC_LIBS "Build FreeGLUT static library." ON)
|
OPTION(BUILD_STATIC_LIBS "Build FreeGLUT static library." ON)
|
||||||
|
|
||||||
|
# option for whether warnings and errors should be printed
|
||||||
|
OPTION(FREEGLUT_ERRORS "Lib prints errors to stderr" ON)
|
||||||
|
#MARK_AS_ADVANCED(FREEGLUT_ERRORS)
|
||||||
|
OPTION(FREEGLUT_WARNINGS "Lib prints warnings to stderr" ON)
|
||||||
|
#MARK_AS_ADVANCED(FREEGLUT_WARNINGS)
|
||||||
|
|
||||||
# option to also copy .pdb files to install directory when executing
|
# option to also copy .pdb files to install directory when executing
|
||||||
# INSTALL target
|
# INSTALL target
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
|
@ -23,3 +23,7 @@
|
|||||||
#define VERSION_MAJOR @VERSION_MAJOR@
|
#define VERSION_MAJOR @VERSION_MAJOR@
|
||||||
#define VERSION_MINOR @VERSION_MINOR@
|
#define VERSION_MINOR @VERSION_MINOR@
|
||||||
#define VERSION_PATCH @VERSION_PATCH@
|
#define VERSION_PATCH @VERSION_PATCH@
|
||||||
|
|
||||||
|
/* warning and errors printed? */
|
||||||
|
#define FREEGLUT_WARNINGS @FREEGLUT_WARNINGS@
|
||||||
|
#define FREEGLUT_ERRORS @FREEGLUT_ERRORS@
|
||||||
|
@ -261,7 +261,7 @@ void fgError( const char *fmt, ... )
|
|||||||
va_end( ap );
|
va_end( ap );
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
#if FREEGLUT_ERRORS
|
||||||
va_start( ap, fmt );
|
va_start( ap, fmt );
|
||||||
|
|
||||||
fprintf( stderr, "freeglut ");
|
fprintf( stderr, "freeglut ");
|
||||||
@ -271,6 +271,7 @@ void fgError( const char *fmt, ... )
|
|||||||
fprintf( stderr, "\n" );
|
fprintf( stderr, "\n" );
|
||||||
|
|
||||||
va_end( ap );
|
va_end( ap );
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( fgState.Initialised )
|
if ( fgState.Initialised )
|
||||||
fgDeinitialize ();
|
fgDeinitialize ();
|
||||||
@ -293,7 +294,7 @@ void fgWarning( const char *fmt, ... )
|
|||||||
va_end( ap );
|
va_end( ap );
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
#if FREEGLUT_WARNINGS
|
||||||
va_start( ap, fmt );
|
va_start( ap, fmt );
|
||||||
|
|
||||||
fprintf( stderr, "freeglut ");
|
fprintf( stderr, "freeglut ");
|
||||||
@ -303,6 +304,7 @@ void fgWarning( const char *fmt, ... )
|
|||||||
fprintf( stderr, "\n" );
|
fprintf( stderr, "\n" );
|
||||||
|
|
||||||
va_end( ap );
|
va_end( ap );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user