Add check for wall switch from cmake

pull/4731/head
Kim Kulling 2022-09-17 18:16:42 +02:00
parent 1944c45944
commit b3c7bdbdd6
4 changed files with 31 additions and 12 deletions

View File

@ -305,19 +305,16 @@ void FBXConverter::ConvertNodes(uint64_t id, aiNode *parent, aiNode *root_node)
}
}
if (nodes.size()) {
parent->mChildren = new aiNode *[nodes.size()]();
parent->mNumChildren = static_cast<unsigned int>(nodes.size());
for (unsigned int i = 0; i < nodes.size(); ++i)
{
parent->mChildren[i] = nodes[i].mOwnership.release();
}
nodes.clear();
} else {
if (nodes.empty()) {
parent->mNumChildren = 0;
parent->mChildren = nullptr;
}
parent->mChildren = new aiNode *[nodes.size()]();
parent->mNumChildren = static_cast<unsigned int>(nodes.size());
for (unsigned int i = 0; i < nodes.size(); ++i) {
parent->mChildren[i] = nodes[i].mOwnership.release();
}
}
void FBXConverter::ConvertLights(const Model &model, const std::string &orig_name) {

View File

@ -263,6 +263,14 @@ IF(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
ENDIF()
IF (ASSIMP_WARNINGS_AS_ERRORS)
IF (MSVC)
TARGET_COMPILE_OPTIONS(unit PRIVATE /W4 /WX)
ELSE()
TARGET_COMPILE_OPTIONS(unit PRIVATE -Wall -Werror)
ENDIF()
ENDIF()
target_link_libraries( unit assimp ${platform_libs} )
add_subdirectory(headercheck)

View File

@ -2,8 +2,6 @@
# ----------------------------------------------------------------------
#
# Copyright (c) 2006-2022, assimp team
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms,
@ -62,6 +60,14 @@ ADD_EXECUTABLE( assimp_cmd
${ASSIMP_CMD_RC}
)
IF (ASSIMP_WARNINGS_AS_ERRORS)
IF (MSVC)
TARGET_COMPILE_OPTIONS(assimp_cmd PRIVATE /W4 /WX)
ELSE()
TARGET_COMPILE_OPTIONS(assimp_cmd PRIVATE -Wall -Werror)
ENDIF()
ENDIF()
TARGET_USE_COMMON_OUTPUT_DIRECTORY(assimp_cmd)
SET_PROPERTY(TARGET assimp_cmd PROPERTY DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})

View File

@ -95,6 +95,14 @@ IF ( MSVC )
REMOVE_DEFINITIONS( -DUNICODE -D_UNICODE )
ENDIF ()
IF (ASSIMP_WARNINGS_AS_ERRORS)
IF (MSVC)
TARGET_COMPILE_OPTIONS(assimp_viewer PRIVATE /W4 /WX)
ELSE()
TARGET_COMPILE_OPTIONS(assimp_viewer PRIVATE -Wall -Werror)
ENDIF()
ENDIF()
# Link the executable to the assimp + dx libs.
TARGET_LINK_LIBRARIES ( assimp_viewer assimp ${DirectX_LIBRARY} ${DirectX_D3DX9_LIBRARY} comctl32 winmm )