From 7aa2a67d8381c9a88d69a3f53d74a7f079214263 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Mon, 9 Mar 2026 21:49:43 +0800 Subject: Establish a well-structured modern C++ project architecture Focus on code quality: Treat strict warnings as errors, memory checks with Sanitizers, Clang formatting and static analysis Performance optimization: LTO, ccache --- etc/build_type.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 etc/build_type.cmake (limited to 'etc/build_type.cmake') diff --git a/etc/build_type.cmake b/etc/build_type.cmake new file mode 100644 index 0000000..69d019f --- /dev/null +++ b/etc/build_type.cmake @@ -0,0 +1,11 @@ +set(default_build_type "Debug") + +if (NOT (CMAKE_BUILD_TYPE_SHADOW STREQUAL CMAKE_BUILD_TYPE)) + if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message (STATUS "Setting build type to '${default_build_type}'") + set (CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE) + endif () + set (CMAKE_BUILD_TYPE_SHADOW ${CMAKE_BUILD_TYPE} CACHE STRING "used to detect changes in build type" FORCE) +endif () + +message (STATUS "Building in '${CMAKE_BUILD_TYPE}' mode.") -- cgit v1.2.3