Fixing some potential heap corruption issues in the Blenderplayer when it is built with CMake. This fix forces Blender and the Blenderplayer to use the same SDNA, since inconsistencies between Blender's and the Blenderplayer's SDNA is what lead to the corruption issues.

This commit is contained in:
Mitchell Stokes 2012-06-07 01:44:22 +00:00
parent 78cf502c80
commit 8beea054f7

@ -31,12 +31,6 @@ if(WITH_CODEC_QUICKTIME)
add_definitions(-DWITH_QUICKTIME)
endif()
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dna.c
COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna ${CMAKE_CURRENT_BINARY_DIR}/dna.c ${CMAKE_SOURCE_DIR}/source/blender/makesdna/
DEPENDS ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna
)
if(WIN32 AND NOT UNIX)
string(SUBSTRING ${BLENDER_VERSION} 0 1 bver1)
string(SUBSTRING ${BLENDER_VERSION} 2 1 bver2)
@ -60,10 +54,10 @@ if(WIN32 AND NOT UNIX)
)
endif()
add_executable(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c ../icons/winblender.rc)
add_executable(blenderplayer ${EXETYPE} bad_level_call_stubs/stubs.c ../icons/winblender.rc)
elseif(APPLE)
add_executable(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c)
add_executable(blenderplayer ${EXETYPE} bad_level_call_stubs/stubs.c)
# setup Info.plist
execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BLENDER_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
set(PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blenderplayer.app)
@ -74,7 +68,7 @@ elseif(APPLE)
MACOSX_BUNDLE_LONG_VERSION_STRING "${BLENDER_VERSION} ${BLENDER_DATE}")
else()
add_executable(blenderplayer ${CMAKE_CURRENT_BINARY_DIR}/dna.c)
add_executable(blenderplayer bad_level_call_stubs/stubs.c)
endif()
add_dependencies(blenderplayer makesdna)