diff --git a/CMakeLists.txt b/CMakeLists.txt index 17e9ad5e7..e8f4a9f60 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -245,13 +245,17 @@ if((${CMAKE_SYSTEM_NAME} MATCHES "Linux|kFreeBSD|GNU") AND (CMAKE_CXX_COMPILER_I endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - # Fix for Debug mode in macOS + # Fix for Debug and None modes in macOS + # without this, get get a runtime error include(CheckCXXCompilerFlag) check_cxx_compiler_flag(-fstandalone-debug HAVE_STANDALONE_DEBUG) check_cxx_compiler_flag(-Og HAVE_OG_FLAG) if(HAVE_STANDALONE_DEBUG AND HAVE_OG_FLAG) set(CMAKE_CXX_FLAGS_DEBUG "-Og -g -fstandalone-debug") set(CMAKE_C_FLAGS_DEBUG "-Og -g -fstandalone-debug") + if(CMAKE_BUILD_TYPE STREQUAL "None") + add_compile_options(-Og -fstandalone-debug) + endif() endif() endif() endif() diff --git a/cmake/Modules/GnsssdrBuildTypes.cmake b/cmake/Modules/GnsssdrBuildTypes.cmake index f948c65c6..01dae1acd 100644 --- a/cmake/Modules/GnsssdrBuildTypes.cmake +++ b/cmake/Modules/GnsssdrBuildTypes.cmake @@ -38,8 +38,8 @@ list(APPEND AVAIL_BUILDTYPES # checks the value set in the cmake interface against the list of # known build types in AVAIL_BUILDTYPES. If the build type is found, # the function exits immediately. If nothing is found by the end of -# checking all available build types, we exit with an error and list -# the available build types. +# checking all available build types, we exit with a soft warning, listing +# the available build types, and setting the build type to None. ######################################################################## function(GNSSSDR_CHECK_BUILD_TYPE settype) string(TOUPPER ${settype} _settype) @@ -49,8 +49,10 @@ function(GNSSSDR_CHECK_BUILD_TYPE settype) return() # found it; exit cleanly endif() endforeach() - # Build type not found; error out - message(FATAL_ERROR "Build type '${settype}' not valid, must be one of: ${AVAIL_BUILDTYPES}") + # Build type not found; warn out at set it to None + message(STATUS "Warning: Build type '${settype}' not valid, must be one of: ${AVAIL_BUILDTYPES}.") + message(STATUS "Setting the build type to 'None'") + set(CMAKE_BUILD_TYPE "None" PARENT_SCOPE) endfunction() diff --git a/docs/changelog.md b/docs/changelog.md index 22c6ed83d..388f342ab 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -49,6 +49,10 @@ SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades