compile on VS2008/VS2010 (#1397)

Compiling with Win32 Release/MinSizeRel/RelWithDebInfo in VS2008 will cause "fatal error C1063: compiler limit: compiler stack overflow" problem.
Compiling with Win32 Debug or x64 does not have this problem.
You can easily bypass this problem by changing the optimization options /O1 and /O2 to /Od.
In VS2010, when _INTPTR is 0 or 1, UINTPTR_MAX is 0xFFFFFFFF.
This commit is contained in:
Sun Daowen
2021-05-16 21:36:33 +08:00
committed by Bet4
parent f27c6fa655
commit 5eab884244
2 changed files with 55 additions and 1 deletions

View File

@ -1000,7 +1000,15 @@ if (MSVC)
qemu/util/qemu-thread-win32.c
)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
enable_language(ASM_MASM)
if (MSVC_VERSION LESS 1600 AND MSVC_IDE)
add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/build/setjmp-wrapper-win32.dir/setjmp-wrapper-win32.obj"
COMMAND ml64 /c /nologo /Fo"${CMAKE_CURRENT_SOURCE_DIR}/build/setjmp-wrapper-win32.dir/setjmp-wrapper-win32.obj" /W3 /errorReport:prompt /Ta"${CMAKE_CURRENT_SOURCE_DIR}/qemu/util/setjmp-wrapper-win32.asm"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/qemu/util/setjmp-wrapper-win32.asm"
)
set(UNICORN_SRCS ${UNICORN_SRCS} "${CMAKE_CURRENT_SOURCE_DIR}/build/setjmp-wrapper-win32.dir/setjmp-wrapper-win32.obj")
else()
enable_language(ASM_MASM)
endif()
set(UNICORN_COMMON_SRCS ${UNICORN_COMMON_SRCS} qemu/util/setjmp-wrapper-win32.asm)
endif()
else()