V9.12 Fix the lnk1189 problem#4596
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
| sat) | ||
| add_subdirectory(ortools/${SAMPLES}/samples) | ||
| endforeach() | ||
| # foreach(SAMPLES IN ITEMS |
There was a problem hiding this comment.
Sorry, it was my fault. I forgot to remove the comment. Very Very Sorry.
There was a problem hiding this comment.
Sorry, it was my fault. I forgot to remove the comment. Very Very Sorry.
|
|
||
| if(MSVC) | ||
| set(CMAKE_CXX_STANDARD 20) | ||
| # 设置源代码和执行字符集为 UTF-8(MSVC 2015 及以上支持 /utf-8) |
There was a problem hiding this comment.
please use english in comment
why MSVC 2015 ? we only support 2022...
| if(MSVC) | ||
| set(CMAKE_CXX_STANDARD 20) | ||
| # 设置源代码和执行字符集为 UTF-8(MSVC 2015 及以上支持 /utf-8) | ||
| message(STATE "set utf-8=======") |
There was a problem hiding this comment.
there is no STATE and this log seems a debug log/dev to suppress imho
| add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>") | ||
| # message(STATE "set bigobj=======") | ||
| add_compile_options(/bigobj) | ||
| SET(CMAKE_CXX_FLAGS_DEBUG "/Od2") |
There was a problem hiding this comment.
why ? I prefer to be conservative and keep the cmake default debug configuration
There was a problem hiding this comment.
My releas compilation caused errors in lnk1189, and I found two solutions on the Internet, so I added both of them. The compilation time was too long, so I added both solutions.
There was a problem hiding this comment.
|
|
||
| # 设置堆栈保留大小为16MB(单位:字节) | ||
| set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:104857600") | ||
| set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /STACK:104857600") |
There was a problem hiding this comment.
Set the stack retention size.
|
this seems to have been IA generated.... |
|
I'm not very good at English, so I have to use a translation software. |
cmake 3.31.3
vs2022
window10
编译debug版本总是报lnk1189的问题,现在修复了。
Compiling debug version always quote lnk1189 issue now fixed.