-
Notifications
You must be signed in to change notification settings - Fork 2.2k
V9.12 Fix the lnk1189 problem #4596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: stable
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,17 @@ message(STATUS "${PROJECT_NAME} version: ${PROJECT_VERSION}") | |
|
||
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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there is no There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry,this is my fault |
||
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>") | ||
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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why ? I prefer to be conservative and keep the cmake default debug configuration There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
# 设置堆栈保留大小为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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please explain There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set the stack retention size. |
||
else() | ||
set(CMAKE_CXX_STANDARD 17) | ||
endif() | ||
|
@@ -443,22 +454,22 @@ include(dotnet) | |
|
||
# Since samples mix all languages we must parse them once we have included all | ||
# <language>.cmake files | ||
foreach(SAMPLES IN ITEMS | ||
algorithms | ||
graph | ||
glop | ||
constraint_solver | ||
linear_solver | ||
${MATH_OPT_DIR} | ||
${PDLP_DIR} | ||
sat) | ||
add_subdirectory(ortools/${SAMPLES}/samples) | ||
endforeach() | ||
# foreach(SAMPLES IN ITEMS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this (and below) ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, it was my fault. I forgot to remove the comment. Very Very Sorry. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, it was my fault. I forgot to remove the comment. Very Very Sorry. |
||
# algorithms | ||
# graph | ||
# glop | ||
# constraint_solver | ||
# linear_solver | ||
# ${MATH_OPT_DIR} | ||
# ${PDLP_DIR} | ||
# sat) | ||
# add_subdirectory(ortools/${SAMPLES}/samples) | ||
# endforeach() | ||
|
||
# Same for examples | ||
foreach(EXAMPLES IN ITEMS contrib cpp dotnet java python) | ||
add_subdirectory(examples/${EXAMPLES}) | ||
endforeach() | ||
# foreach(EXAMPLES IN ITEMS contrib cpp dotnet java python) | ||
# add_subdirectory(examples/${EXAMPLES}) | ||
# endforeach() | ||
|
||
# Add tests in examples/tests | ||
add_subdirectory(examples/tests) | ||
# add_subdirectory(examples/tests) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use english in comment
why MSVC 2015 ? we only support 2022...