Use RelWithDebInfo

This commit is contained in:
momo5502
2025-05-29 10:13:17 +02:00
parent 5022e3049a
commit b5f84a3623
3 changed files with 6 additions and 23 deletions

View File

@@ -23,7 +23,7 @@
"build"
],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{

View File

@@ -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()

View File

@@ -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()