From 35ced14e45e751b8159589ee68f7ef4dfe8ad2ed Mon Sep 17 00:00:00 2001 From: slothlife Date: Mon, 22 Sep 2014 21:33:09 -0500 Subject: [PATCH] Fix for MSVC warnings --- CMakeLists.txt | 7 ++++++- components/compiler/lineparser.cpp | 2 +- plugins/mygui_resource_plugin/CMakeLists.txt | 8 ++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 885589ba4..01e7b1296 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -639,6 +639,9 @@ if (WIN32) 4251 # class 'XXXX' needs to have dll-interface to be used by clients of class 'YYYY' 4275 # non dll-interface struct 'XXXX' used as base for dll-interface class 'YYYY' + # caused by boost + 4191 # 'type cast' : unsafe conversion (1.56, thread_primitives.hpp, normally off) + # OpenMW specific warnings 4099 # Type mismatch, declared class or struct is defined with other type 4100 # Unreferenced formal parameter (-Wunused-parameter) @@ -682,7 +685,9 @@ if (WIN32) set_target_properties(esmtool PROPERTIES COMPILE_FLAGS ${WARNINGS}) endif (BUILD_ESMTOOL) if (BUILD_OPENCS) - set_target_properties(opencs PROPERTIES COMPILE_FLAGS ${WARNINGS}) + # QT triggers an informational warning that the object layout may differ when compiled with /vd2 + set(OPENCS_WARNINGS "${WARNINGS} /wd4435") + set_target_properties(opencs PROPERTIES COMPILE_FLAGS ${OPENCS_WARNINGS}) endif (BUILD_OPENCS) if (BUILD_MWINIIMPORTER) set_target_properties(mwiniimport PROPERTIES COMPILE_FLAGS ${WARNINGS}) diff --git a/components/compiler/lineparser.cpp b/components/compiler/lineparser.cpp index c5e236f14..7d554f2ec 100644 --- a/components/compiler/lineparser.cpp +++ b/components/compiler/lineparser.cpp @@ -311,7 +311,7 @@ namespace Compiler extensions->generateInstructionCode (keyword, mCode, mLiterals, mExplicit, optionals); } - catch (const SourceException& exception) + catch (const SourceException&) { // Ignore argument exceptions for positioncell. /// \todo add option to disable this diff --git a/plugins/mygui_resource_plugin/CMakeLists.txt b/plugins/mygui_resource_plugin/CMakeLists.txt index 7288fd4b6..72965c917 100644 --- a/plugins/mygui_resource_plugin/CMakeLists.txt +++ b/plugins/mygui_resource_plugin/CMakeLists.txt @@ -15,6 +15,14 @@ add_library(${MYGUI_RESOURCE_PLUGIN_LIBRARY} ${MYGUI_RESOURCE_PLUGIN_SOURCES} ) +if(WIN32) + if(MSVC) + # from top-level CMakelists.txt: + # 4305 - Truncating value (double to float, for example) + set_target_properties(${MYGUI_RESOURCE_PLUGIN_LIBRARY} PROPERTIES COMPILE_FLAGS "/wd4305") + endif(MSVC) +endif(WIN32) + set_target_properties(${MYGUI_RESOURCE_PLUGIN_LIBRARY} PROPERTIES PREFIX "") target_link_libraries(${MYGUI_RESOURCE_PLUGIN_LIBRARY}