Takes compilation profile from command line.
authorBartlomiej Grzelewski <b.grzelewski@samsung.com>
Thu, 1 Aug 2013 10:53:19 +0000 (12:53 +0200)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Tue, 10 Sep 2013 15:49:39 +0000 (15:49 +0000)
This command will start compilation with debug(-O0 -g -ggdb)
    gbs lb -A armv7l --define "build_type DEBUG"

 Default command will use RELEASE profile(-02 -g):
    gbs lb -A armv7l

[Issue#]   N/A
[Bug]      N/A
[Cause]    N/A
[Problem]  N/A
[Solution] N/A

[Verification] Run tests.

Change-Id: I4bc6f0b0ee2c98919f47c7550c609d9bf5b396de

CMakeLists.txt
packaging/libprivilege-control.spec

index 7c5b0ea..aa7f2c8 100644 (file)
@@ -19,8 +19,13 @@ FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
-SET(CMAKE_C_FLAGS_CCOV "--coverage")
-SET(CMAKE_CXX_FLAGS_CCOV "--coverage")
+# TIZEN_ENGINEER_MODE is used in  dlog.h file.
+# Without this flag all logs defined with SLOGD macro
+# will be expanded to empty instruction.
+
+SET(CMAKE_C_FLAGS_CCOV    "--coverage")
+SET(CMAKE_C_FLAGS_DEBUG   "-O0 -g -ggdb -DDLOG_DEBUG_ENABLED -DTIZEN_ENGINEER_MODE")
+SET(CMAKE_C_FLAGS_RELEASE "-O2 -g")
 
 SET(src_dir "./src")
 SET(include_dir "./include")
index a61a9fb..ed0af44 100644 (file)
@@ -43,7 +43,7 @@ Library to control privilege of application files
 
 %build
 export CFLAGS="${CFLAGS} -Wno-implicit-function-declaration"
-%cmake . -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}
+%cmake . -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE}
 
 make %{?jobs:-j%jobs}