Add check for wall switch from cmake

This commit is contained in:
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

@@ -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 )