Increase max stack size to 8 MB on Windows

Default is 1 MB and it could cause problems in compiling heavy SPU LLVM functions.
This commit is contained in:
Nekotekina 2019-04-14 15:11:07 +03:00
parent c1edae73c5
commit b97a1aeca2
2 changed files with 8 additions and 0 deletions

View File

@ -44,6 +44,9 @@ if(NOT MSVC)
# Workaround for mingw64 (MSYS2)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--allow-multiple-definition")
# Increase stack limit to 8 MB
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--stack -Wl,8388608")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__STDC_FORMAT_MACROS=1")
endif()
@ -76,6 +79,9 @@ else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D _ENABLE_EXTENDED_ALIGNED_STORAGE=1")
# Increase stack limit to 8 MB
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /STACK:8388608,1048576")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /DYNAMICBASE:NO /BASE:0x10000 /FIXED")
endif()

View File

@ -24,6 +24,8 @@
<Link>
<AdditionalDependencies>xxhash.lib;ws2_32.lib;avcodec.lib;avformat.lib;avutil.lib;swresample.lib;swscale.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>..\3rdparty\ffmpeg\Windows\x86_64\lib</AdditionalLibraryDirectories>
<StackReserveSize>8388608</StackReserveSize>
<StackCommitSize>1048576</StackCommitSize>
</Link>
</ItemDefinitionGroup>
<ItemGroup />