diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-07-06 16:10:33 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-07-10 16:01:48 +0200 |
commit | 332f377e84a673cdcfe52ce71c932f39c4b48022 (patch) | |
tree | 6a7cf77ea05abd7c23b4a6e1db5bf011edbf38a4 | |
parent | 1ec753146fa7b2fe7187765fd51e167db4bee3c9 (diff) |
Be able to overwrite BUILD_TYPE using CLIsandbox/sdesneux/4a_master
If not defined using CLI CMake set the variable CMAKE_BUILD_TYPE
to an empty value. As it is a CACHE variable it can't be
overwritten except if you force it. This fix setting this variable
the first defined value wins:
CLI > Config.cmake > Default value (DEBUG)
Change-Id: I7ff3c9063febf71b898fa7f19058ce2fb25fae01
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r-- | cmake/cmake.d/01-build_options.cmake | 9 | ||||
-rw-r--r-- | samples.d/config.cmake.sample | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/cmake/cmake.d/01-build_options.cmake b/cmake/cmake.d/01-build_options.cmake index 36830f1..18aff71 100644 --- a/cmake/cmake.d/01-build_options.cmake +++ b/cmake/cmake.d/01-build_options.cmake @@ -32,7 +32,14 @@ INCLUDE(CheckIncludeFiles) INCLUDE(CheckLibraryExists) INCLUDE(GNUInstallDirs) -set(CMAKE_BUILD_TYPE Debug CACHE STRING "the type of build") +if(NOT CMAKE_BUILD_TYPE) + if(BUILD_TYPE) + set(CMAKE_BUILD_TYPE ${BUILD_TYPE} CACHE STRING "the type of build" FORCE) + else() + set(CMAKE_BUILD_TYPE DEBUG CACHE STRING "the type of build" FORCE) + endif() +endif() + set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMP0048 1) diff --git a/samples.d/config.cmake.sample b/samples.d/config.cmake.sample index d7268cd..70715fc 100644 --- a/samples.d/config.cmake.sample +++ b/samples.d/config.cmake.sample @@ -41,7 +41,7 @@ set(PROJECT_APP_TEMPLATES_DIR "conf.d/app-templates") # Compilation Mode (DEBUG, RELEASE) # ---------------------------------- -#set(CMAKE_BUILD_TYPE "DEBUG") +#set(BUILD_TYPE "DEBUG") #set(USE_EFENCE 1) # Kernel selection if needed. You can choose between a |