From 7ef721a1f3ab4cefd97c1265c6f358f07256189a Mon Sep 17 00:00:00 2001 From: tryh4rd-26 Date: Tue, 3 Mar 2026 17:13:04 +0530 Subject: [PATCH] Set default build type if not provided --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ff1fe4653..e708c48b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,13 @@ endif() if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) project(CppInterOp) + if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(WARNING "No build type selected. Defaulted CMAKE_BUILD_TYPE=Release.\n" + "Valid options are: None, Debug, Release, RelWithDebInfo, MinSizeRel.") + set(CMAKE_BUILD_TYPE Release CACHE STRING + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel" FORCE) + endif() + # LLVM/Clang/Cling default paths if (DEFINED LLVM_DIR) if (NOT DEFINED Clang_DIR)