diff --git a/CMakeLists.txt b/CMakeLists.txt index 2aa6f2125..123794edc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -191,6 +191,11 @@ IF(WIN32) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") ENDIF(WIN32_USE_MP) + # turn off various warnings + foreach(warning 4244 4251 4267 4275 4290 4786 4305 4996) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd${warning}") + endforeach(warning) + # More MSVC specific compilation flags ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS) ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) diff --git a/include/osg/Export b/include/osg/Export index 05d26c698..af9af4485 100644 --- a/include/osg/Export +++ b/include/osg/Export @@ -19,17 +19,6 @@ // well placed for compatibility with future versions. #define USE_DEPRECATED_API -#if defined(_MSC_VER) - #pragma warning( disable : 4244 ) - #pragma warning( disable : 4251 ) - #pragma warning( disable : 4267 ) - #pragma warning( disable : 4275 ) - #pragma warning( disable : 4290 ) - #pragma warning( disable : 4786 ) - #pragma warning( disable : 4305 ) - #pragma warning( disable : 4996 ) -#endif - #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__) # if defined( OSG_LIBRARY_STATIC ) # define OSG_EXPORT