From 0e08e052389fe740c54878cf681cdad01bef0c25 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 21 Jan 2016 13:56:41 -0800 Subject: [PATCH] Only set REALM_DEBUG for debug builds --- CMake/CompilerFlags.cmake | 4 ++-- CMakeLists.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMake/CompilerFlags.cmake b/CMake/CompilerFlags.cmake index fffbb8f4..d45392e4 100644 --- a/CMake/CompilerFlags.cmake +++ b/CMake/CompilerFlags.cmake @@ -1,8 +1,8 @@ set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED on) set(CMAKE_CXX_EXTENSIONS off) -set(CMAKE_BUILD_TYPE CACHE STRING Debug) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -DREALM_HAVE_CONFIG -DREALM_DEBUG") +add_compile_options(-Wall -DREALM_HAVE_CONFIG) +add_compile_options("$<$:-DREALM_DEBUG>") if(${CMAKE_GENERATOR} STREQUAL "Ninja") if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") diff --git a/CMakeLists.txt b/CMakeLists.txt index 85138132..895d4d8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,4 @@ +set(CMAKE_BUILD_TYPE Debug CACHE STRING "") project(realm-object-store) cmake_minimum_required(VERSION 3.2.0)