Allows debug builds to be enabled for GBS & Ubuntu builds 41/71241/3
authorTom Robinson <tom.robinson@samsung.com>
Tue, 24 May 2016 15:03:12 +0000 (16:03 +0100)
committerTom Robinson <tom.robinson@samsung.com>
Wed, 25 May 2016 10:30:35 +0000 (11:30 +0100)
You can now enable a debug build of DALi via GBS by adding the following to your GBS build line:

--define "%enable_debug 1"

Details in README file.

Change-Id: Ie587690ac1871d17905e83b70ce251d64f88dff2

README
build/tizen/CMakeLists.txt
packaging/com.samsung.dali-demo.spec

diff --git a/README b/README
index 1103da8..05417af 100644 (file)
--- a/README
+++ b/README
@@ -4,9 +4,11 @@ T.O.C.
  1.   GBS Builds
  1.1. NON-SMACK Targets
  1.2. SMACK enabled Targets
+ 1.3. DEBUG Builds
  2.   Building for Ubuntu desktop
  2.1. Minimum Requirements
  2.2. Building the Repository
+ 2.3. DEBUG Builds
  3.   Creating an example
  4.   Installing Emscripten examples
 
@@ -24,6 +26,11 @@ T.O.C.
 
  gbs build -A [TARGET_ARCH] --define "%enable_dali_smack_rules 1"
 
+1.3. DEBUG Builds
+-----------------
+
+ gbs build -A [TARGET_ARCH] --define "%enable_debug 1"
+
 
 
 2. Building for Ubuntu desktop
@@ -47,6 +54,16 @@ Then run the following commands:
  cmake -DCMAKE_INSTALL_PREFIX=$DESKTOP_PREFIX .
  make install -j8
 
+2.3. DEBUG Builds
+-----------------
+
+Specify a debug build when building for desktop by passing the following parameter to cmake:
+
+ cmake -DCMAKE_INSTALL_PREFIX=$DESKTOP_PREFIX -DCMAKE_BUILD_TYPE=Debug .
+
+Before running make install as normal:
+
+ make install -j8
 
 
 3. Creating an example
index e98c386..5d3d28f 100644 (file)
@@ -16,6 +16,11 @@ ELSE()
         SET(BINDIR ${PREFIX}/bin)
 ENDIF()
 
+MESSAGE( STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} )
+if(CMAKE_BUILD_TYPE MATCHES Debug)
+    MESSAGE("Setting variable: DEBUG_ENABLED")
+    SET(DEBUG_ENABLED "1")
+ENDIF()
 
 SET(RESOURCE_DIR ${ROOT_SRC_DIR}/resources)
 SET(LOCAL_IMAGES_DIR ${RESOURCE_DIR}/images)
index 63e4e87..bb5cb50 100755 (executable)
@@ -70,7 +70,14 @@ LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed"
 CXXFLAGS+=" -D_ARCH_ARM_"
 %endif
 
-cd %{_builddir}/%{name}-%{version}/build/tizen && cmake -DDALI_APP_DIR=%{dali_app_ro_dir} -DLOCALE_DIR=%{locale_dir} -DLOCAL_STYLE_DIR=%{local_style_dir} .
+cd %{_builddir}/%{name}-%{version}/build/tizen
+
+cmake -DDALI_APP_DIR=%{dali_app_ro_dir} \
+      -DLOCALE_DIR=%{locale_dir} \
+%if 0%{?enable_debug}
+      -DCMAKE_BUILD_TYPE=Debug \
+%endif
+      -DLOCAL_STYLE_DIR=%{local_style_dir} .
 
 make %{?jobs:-j%jobs}