[cmake] set default build type

set with CACHE STRING FORCE to properly be picked up by configuration
tools
This commit is contained in:
akallabeth 2023-08-03 09:45:43 +02:00 committed by akallabeth
parent 0e458c8c2c
commit 8470b6ea26
9 changed files with 41 additions and 20 deletions

View File

@ -26,6 +26,11 @@ set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON)
# Default to release build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "project default" FORCE)
endif()
add_custom_target(fuzzers
COMMENT "Build fuzzers")
@ -196,10 +201,6 @@ endif(CMAKE_CROSSCOMPILING)
# Turn on solution folders (2.8.4+)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Default to release build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
set(LIB_DEFAULT ON)
if (IOS)

View File

@ -5,6 +5,10 @@ project(MacFreeRDP-library)
cmake_policy(SET CMP0026 OLD)
cmake_policy(SET CMP0045 OLD)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "project default" FORCE)
endif()
set(MODULE_NAME "MacFreeRDP-library")
set(MODULE_OUTPUT_NAME "MacFreeRDP")
set(MODULE_PREFIX "FREERDP_CLIENT_MAC_LIBRARY")

View File

@ -39,6 +39,10 @@ option(WITH_DEBUG_SDL_EVENTS "[dangerous, not for release builds!] Debug SDL eve
option(WITH_DEBUG_SDL_KBD_EVENTS "[dangerous, not for release builds!] Debug SDL keyboard events" OFF)
option(WITH_WIN_CONSOLE "Build ${PROJECT_NAME} with console support" ON)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "project default" FORCE)
endif()
# Configure MSVC Runtime
if(MSVC)
include(MSVCRuntime)

View File

@ -27,6 +27,10 @@ option(CMAKE_VERBOSE_MAKEFILE "verbose CMake makefile" ON)
option(CMAKE_POSITION_INDEPENDENT_CODE "build with position independent code (-fPIC or -fPIE)" ON)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "project default" FORCE)
endif()
include(ConfigureFreeRDP)
include(GNUInstallDirsWrapper)

View File

@ -28,6 +28,10 @@ option(CMAKE_VERBOSE_MAKEFILE "verbose CMake makefile" ON)
option(CMAKE_POSITION_INDEPENDENT_CODE "build with position independent code (-fPIC or -fPIE)" ON)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "project default" FORCE)
endif()
include(ConfigureFreeRDP)
include(GNUInstallDirsWrapper)

View File

@ -16,6 +16,10 @@
# limitations under the License.
project(iFreeRDP)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "project default" FORCE)
endif()
set(MODULE_NAME "iFreeRDP")
set(MODULE_PREFIX "IFREERDP_CLIENT")
set(APP_TYPE MACOSX_BUNDLE)

View File

@ -44,13 +44,13 @@ if (NOT FREERDP_UNIFIED_BUILD)
set(WINPR_VERSION_MAJOR 3)
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(EXPORT_ALL_SYMBOLS "Export all symbols form library" OFF)
option(EXPORT_ALL_SYMBOLS "Export all symbols form library" OFF)
option(BUILD_TESTING "Build library unit tests" ON)
option(WITH_LIBRARY_VERSIONING "Use library version triplet" ON)
# Default to release build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "project default" FORCE)
endif()
if(CMAKE_COMPILER_IS_GNUCC)

View File

@ -65,8 +65,8 @@ include(SetFreeRDPCMakeInstallDir)
include(CMakePackageConfigHelpers)
include(GNUInstallDirsWrapper)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "project default" FORCE)
endif()
if (NOT IOS)

View File

@ -293,7 +293,7 @@ endif()
# Default to release build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "project default" FORCE)
endif()
if(BUILD_SHARED_LIBS)