From ee24f5609c8e84112b0cdddb1a74e05cc7076723 Mon Sep 17 00:00:00 2001 From: qiuchun <362460803@qq.com> Date: Fri, 28 Feb 2025 19:29:19 +0800 Subject: [PATCH 1/2] Fix a problem with msvc being incompatible with utf 8 (not utf 8-bom) --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d023d4c82ea..bc104e9dde8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,10 @@ 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=======") + add_compile_options("$<$:/utf-8>") + add_compile_options("$<$:/utf-8>") else() set(CMAKE_CXX_STANDARD 17) endif() From 78489ebdae304233e9dbcac87eb029dfb5244e78 Mon Sep 17 00:00:00 2001 From: qiuchun <362460803@qq.com> Date: Tue, 18 Mar 2025 08:59:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fixed:=E4=BF=AE=E5=A4=8Ddebug=E7=89=88?= =?UTF-8?q?=E6=9C=AClnk1189=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bc104e9dde8..61e25d38b34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,13 @@ if(MSVC) message(STATE "set utf-8=======") add_compile_options("$<$:/utf-8>") add_compile_options("$<$:/utf-8>") + # message(STATE "set bigobj=======") + add_compile_options(/bigobj) + SET(CMAKE_CXX_FLAGS_DEBUG "/Od2") + + # 设置堆栈保留大小为16MB(单位:字节) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:104857600") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /STACK:104857600") else() set(CMAKE_CXX_STANDARD 17) endif() @@ -447,22 +454,22 @@ include(dotnet) # Since samples mix all languages we must parse them once we have included all # .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 +# 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)