I just tried your code and unfortunately /STACK still shows up for DLL targets, although for EXE targets it seems to be gone.<br><br><div class="gmail_quote">On Wed, Jun 27, 2012 at 2:24 PM, David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Try my code, and tell us if it removes the generated /STACK from all<br>
your linker calls or not...<br>
<br>
Thx,<br>
David<br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, Jun 27, 2012 at 3:22 PM, Robert Dailey <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>> wrote:<br>
> Apparently this won't work... /STACK doesn't show up in any of the compile<br>
> flags retrieved this way. However, CMAKE_EXE_COMPILER_FLAGS doesn't apply to<br>
> library targets, right?<br>
><br>
><br>
> On Wed, Jun 27, 2012 at 2:19 PM, Robert Dailey <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>><br>
> wrote:<br>
>><br>
>> This flag is appended to DLL targets too, so I created this (i haven't<br>
>> tested it yet though):<br>
>><br>
>> function( _remove_stack_flag target_name )<br>
>> get_property( flags TARGET ${target_name} PROPERTY COMPILE_FLAGS )<br>
>> string( REGEX REPLACE "/STACK:[0-9]+" "" flags ${flags} )<br>
>> set_property( TARGET ${target_name} PROPERTY COMPILE_FLAGS ${flags} )<br>
>> endfunction()<br>
>><br>
>> I call this once for each target I define.<br>
>><br>
>><br>
>> On Wed, Jun 27, 2012 at 2:17 PM, David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>><br>
>> wrote:<br>
>>><br>
>>> You could do:<br>
>>><br>
>>> string(REPLACE "/STACK:10000000 " "" CMAKE_EXE_LINKER_FLAGS<br>
>>> "${CMAKE_EXE_LINKER_FLAGS}")<br>
>>><br>
>>> after the first project command in the top level CMakeLists file. (Or<br>
>>> "/STACK:some other number" to change it, instead of the empty string<br>
>>> to just remove it...)<br>
>>><br>
>>> The /STACK string only appears in the two files:<br>
>>><br>
>>> Modules/Platform/Windows-Intel.cmake<br>
>>> Modules/Platform/Windows-cl.cmake<br>
>>><br>
>>><br>
>>> HTH,<br>
>>> David<br>
>>><br>
>>><br>
>>> On Wed, Jun 27, 2012 at 3:11 PM, Robert Dailey <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>><br>
>>> wrote:<br>
>>> > This is added to every generated visual studio project from version 7.1<br>
>>> > to<br>
>>> > 9. How can I tell CMake not to modify the stack size?<br>
>>> > --<br>
>>> ><br>
>>> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>>> ><br>
>>> > Visit other Kitware open-source projects at<br>
>>> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>> ><br>
>>> > Please keep messages on-topic and check the CMake FAQ at:<br>
>>> > <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
>>> ><br>
>>> > Follow this link to subscribe/unsubscribe:<br>
>>> > <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
>><br>
>><br>
><br>
</div></div></blockquote></div><br>