From Farshid Lashkari, "I noticed that CMake forces a high stack size by default for all MSVC projects. This can cause problems for applications that use a lot of threads. I've added a new option MSVC_USE_DEFAULT_STACK_SIZE that will remove the explicit stack size and use the default MSVC size. Apparently this was only necessary for very old versions of MSVC but it's still around. I would argue that this option should be on by default, but I've left it off for now.
"
This commit is contained in:
parent
1b6adccdc4
commit
2b7fb78c75
@ -206,6 +206,15 @@ IF(WIN32)
|
||||
IF(MSVC_DISABLE_CHECKED_ITERATORS)
|
||||
ADD_DEFINITIONS(-D_SECURE_SCL=0)
|
||||
ENDIF(MSVC_DISABLE_CHECKED_ITERATORS)
|
||||
|
||||
OPTION(MSVC_USE_DEFAULT_STACK_SIZE "Set to ON to use the default Visual C++ stack size. CMake forces a high stack size by default, which can cause problems for applications with large number of threads." OFF)
|
||||
MARK_AS_ADVANCED(MSVC_USE_DEFAULT_STACK_SIZE)
|
||||
IF(MSVC_USE_DEFAULT_STACK_SIZE)
|
||||
STRING(REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
|
||||
STRING(REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
STRING(REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
|
||||
ENDIF(MSVC_USE_DEFAULT_STACK_SIZE)
|
||||
|
||||
ENDIF()
|
||||
|
||||
#needed for net plugin
|
||||
|
Loading…
Reference in New Issue
Block a user