diff --git a/CMakePresets.json b/CMakePresets.json index d7a107f3..5e0e6de9 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -23,7 +23,7 @@ "build" ], "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" + "CMAKE_BUILD_TYPE": "RelWithDebInfo" } }, { diff --git a/cmake/compiler-env.cmake b/cmake/compiler-env.cmake index 3d48bc0c..f8d770e5 100644 --- a/cmake/compiler-env.cmake +++ b/cmake/compiler-env.cmake @@ -145,10 +145,6 @@ if(MSVC) /INCREMENTAL:NO ) - momo_add_c_and_cxx_release_compile_options( - /Ob2 - ) - add_compile_definitions( _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS @@ -199,24 +195,6 @@ endif() ########################################## -set(OPT_DEBUG "-O0 -g") -set(OPT_RELEASE "-O3 -g") - -if(MSVC) - set(OPT_DEBUG "/Od /Ob0 /Z7") - set(OPT_RELEASE "/O2 /Ob2 /Z7") - - add_link_options(/DEBUG) -endif() - -set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${OPT_DEBUG}") -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${OPT_DEBUG}") - -set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${OPT_RELEASE}") -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${OPT_RELEASE}") - -########################################## - if(CMAKE_GENERATOR MATCHES "Visual Studio") momo_add_c_and_cxx_compile_options(/MP) endif() diff --git a/cmake/sccache.cmake b/cmake/sccache.cmake index 8d5b6db2..11179d16 100644 --- a/cmake/sccache.cmake +++ b/cmake/sccache.cmake @@ -5,4 +5,9 @@ find_program(SCCACHE sccache) if (SCCACHE) set(CMAKE_C_COMPILER_LAUNCHER ${SCCACHE}) set(CMAKE_CXX_COMPILER_LAUNCHER ${SCCACHE}) + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded) + + if(POLICY CMP0141) + cmake_policy(SET CMP0141 NEW) + endif() endif()