forked from mirror/openmw-tes3mp
[General] Add ENABLE_PVS option to CMake
This commit is contained in:
parent
9b6bdf3ae8
commit
5282541d3a
5 changed files with 19 additions and 29 deletions
|
@ -16,6 +16,8 @@ option(BUILD_NIFTEST "build nif file tester" OFF)
|
||||||
option(BUILD_MYGUI_PLUGIN "build MyGUI plugin for OpenMW resources, to use with MyGUI tools" ON)
|
option(BUILD_MYGUI_PLUGIN "build MyGUI plugin for OpenMW resources, to use with MyGUI tools" ON)
|
||||||
option(BUILD_DOCS "build documentation." OFF )
|
option(BUILD_DOCS "build documentation." OFF )
|
||||||
|
|
||||||
|
option(ENABLE_PVS "Enable PVS Studio Analyzer" FALSE)
|
||||||
|
|
||||||
if (NOT BUILD_LAUNCHER AND NOT BUILD_BROWSER AND NOT BUILD_OPENCS AND NOT BUILD_WIZARD)
|
if (NOT BUILD_LAUNCHER AND NOT BUILD_BROWSER AND NOT BUILD_OPENCS AND NOT BUILD_WIZARD)
|
||||||
set(USE_QT FALSE)
|
set(USE_QT FALSE)
|
||||||
else()
|
else()
|
||||||
|
|
|
@ -220,7 +220,9 @@ if (MSVC)
|
||||||
add_definitions("-D_USE_MATH_DEFINES")
|
add_definitions("-D_USE_MATH_DEFINES")
|
||||||
endif (MSVC)
|
endif (MSVC)
|
||||||
|
|
||||||
|
if (ENABLE_PVS)
|
||||||
pvs_studio_add_target(TARGET tes3mp-server.analyze ALL
|
pvs_studio_add_target(TARGET tes3mp-server.analyze ALL
|
||||||
OUTPUT FORMAT errorfile
|
OUTPUT FORMAT errorfile
|
||||||
ANALYZE tes3mp-server
|
ANALYZE tes3mp-server
|
||||||
LOG target_tes3mp-server.err)
|
LOG target_tes3mp-server.err)
|
||||||
|
endif()
|
||||||
|
|
|
@ -265,3 +265,10 @@ endif (MSVC)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
INSTALL(TARGETS tes3mp RUNTIME DESTINATION ".")
|
INSTALL(TARGETS tes3mp RUNTIME DESTINATION ".")
|
||||||
endif (WIN32)
|
endif (WIN32)
|
||||||
|
|
||||||
|
if (ENABLE_PVS)
|
||||||
|
pvs_studio_add_target(TARGET tes3mp.analyze ALL
|
||||||
|
OUTPUT FORMAT errorfile
|
||||||
|
ANALYZE tes3mp
|
||||||
|
LOG target_tes3mp.err)
|
||||||
|
endif()
|
||||||
|
|
|
@ -307,7 +307,9 @@ endif()
|
||||||
# Make the variable accessible for other subdirectories
|
# Make the variable accessible for other subdirectories
|
||||||
set(COMPONENT_FILES ${COMPONENT_FILES} PARENT_SCOPE)
|
set(COMPONENT_FILES ${COMPONENT_FILES} PARENT_SCOPE)
|
||||||
|
|
||||||
|
if (ENABLE_PVS)
|
||||||
pvs_studio_add_target(TARGET components.analyze ALL
|
pvs_studio_add_target(TARGET components.analyze ALL
|
||||||
OUTPUT FORMAT errorfile
|
OUTPUT FORMAT errorfile
|
||||||
ANALYZE components
|
ANALYZE components
|
||||||
LOG target_components.err)
|
LOG target_components.err)
|
||||||
|
endif()
|
||||||
|
|
|
@ -91,9 +91,7 @@ void PacketRecordDynamic::Packet(RakNet::BitStream *bs, bool send)
|
||||||
RW(record.baseId, send, true);
|
RW(record.baseId, send, true);
|
||||||
RW(recordData.mId, send, true);
|
RW(recordData.mId, send, true);
|
||||||
RW(recordData.mName, send, true);
|
RW(recordData.mName, send, true);
|
||||||
RW(recordData.mData.mType, send);
|
RW(recordData.mData, send, true);
|
||||||
RW(recordData.mData.mCost, send);
|
|
||||||
RW(recordData.mData.mFlags, send);
|
|
||||||
ProcessEffects(recordData.mEffects, send);
|
ProcessEffects(recordData.mEffects, send);
|
||||||
|
|
||||||
if (!record.baseId.empty())
|
if (!record.baseId.empty())
|
||||||
|
@ -118,9 +116,7 @@ void PacketRecordDynamic::Packet(RakNet::BitStream *bs, bool send)
|
||||||
RW(recordData.mName, send, true);
|
RW(recordData.mName, send, true);
|
||||||
RW(recordData.mModel, send, true);
|
RW(recordData.mModel, send, true);
|
||||||
RW(recordData.mIcon, send, true);
|
RW(recordData.mIcon, send, true);
|
||||||
RW(recordData.mData.mWeight, send);
|
RW(recordData.mData, send, true);
|
||||||
RW(recordData.mData.mValue, send);
|
|
||||||
RW(recordData.mData.mAutoCalc, send);
|
|
||||||
RW(recordData.mScript, send, true);
|
RW(recordData.mScript, send, true);
|
||||||
ProcessEffects(recordData.mEffects, send);
|
ProcessEffects(recordData.mEffects, send);
|
||||||
|
|
||||||
|
@ -146,10 +142,7 @@ void PacketRecordDynamic::Packet(RakNet::BitStream *bs, bool send)
|
||||||
|
|
||||||
RW(record.baseId, send, true);
|
RW(record.baseId, send, true);
|
||||||
RW(recordData.mId, send, true);
|
RW(recordData.mId, send, true);
|
||||||
RW(recordData.mData.mType, send);
|
RW(recordData.mData, send, true);
|
||||||
RW(recordData.mData.mCost, send);
|
|
||||||
RW(recordData.mData.mCharge, send);
|
|
||||||
RW(recordData.mData.mAutocalc, send);
|
|
||||||
ProcessEffects(recordData.mEffects, send);
|
ProcessEffects(recordData.mEffects, send);
|
||||||
|
|
||||||
if (!record.baseId.empty())
|
if (!record.baseId.empty())
|
||||||
|
@ -259,12 +252,7 @@ void PacketRecordDynamic::Packet(RakNet::BitStream *bs, bool send)
|
||||||
RW(recordData.mName, send, true);
|
RW(recordData.mName, send, true);
|
||||||
RW(recordData.mModel, send, true);
|
RW(recordData.mModel, send, true);
|
||||||
RW(recordData.mIcon, send, true);
|
RW(recordData.mIcon, send, true);
|
||||||
RW(recordData.mData.mType, send);
|
RW(recordData.mData, send, true);
|
||||||
RW(recordData.mData.mWeight, send);
|
|
||||||
RW(recordData.mData.mValue, send);
|
|
||||||
RW(recordData.mData.mHealth, send);
|
|
||||||
RW(recordData.mData.mArmor, send);
|
|
||||||
RW(recordData.mData.mEnchant, send);
|
|
||||||
RW(recordData.mEnchant, send, true);
|
RW(recordData.mEnchant, send, true);
|
||||||
RW(recordData.mScript, send, true);
|
RW(recordData.mScript, send, true);
|
||||||
ProcessBodyParts(recordData.mParts, send);
|
ProcessBodyParts(recordData.mParts, send);
|
||||||
|
@ -299,11 +287,7 @@ void PacketRecordDynamic::Packet(RakNet::BitStream *bs, bool send)
|
||||||
RW(recordData.mModel, send, true);
|
RW(recordData.mModel, send, true);
|
||||||
RW(recordData.mIcon, send, true);
|
RW(recordData.mIcon, send, true);
|
||||||
RW(recordData.mText, send, true);
|
RW(recordData.mText, send, true);
|
||||||
RW(recordData.mData.mWeight, send);
|
RW(recordData.mData, send, true);
|
||||||
RW(recordData.mData.mValue, send);
|
|
||||||
RW(recordData.mData.mIsScroll, send);
|
|
||||||
RW(recordData.mData.mSkillId, send);
|
|
||||||
RW(recordData.mData.mEnchant, send);
|
|
||||||
RW(recordData.mEnchant, send, true);
|
RW(recordData.mEnchant, send, true);
|
||||||
RW(recordData.mScript, send, true);
|
RW(recordData.mScript, send, true);
|
||||||
|
|
||||||
|
@ -462,14 +446,7 @@ void PacketRecordDynamic::ProcessEffects(ESM::EffectList &effectList, bool send)
|
||||||
|
|
||||||
for (auto &&effect : effectList.mList)
|
for (auto &&effect : effectList.mList)
|
||||||
{
|
{
|
||||||
RW(effect.mEffectID, send);
|
RW(effect, send, true);
|
||||||
RW(effect.mAttribute, send);
|
|
||||||
RW(effect.mSkill, send);
|
|
||||||
RW(effect.mRange, send);
|
|
||||||
RW(effect.mArea, send);
|
|
||||||
RW(effect.mDuration, send);
|
|
||||||
RW(effect.mMagnMax, send);
|
|
||||||
RW(effect.mMagnMin, send);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue