#
# @file CMakeLists.txt
# @author Aleksander Zdyb <a.zdyb@samsung.com>
+# @author Oskar Świtalski <o.switalski@samsung.com>
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
OPTION(WITH_TESTS "Build tests" ON)
+############################# compiler flags ##################################
+
+SET(CMAKE_CXX_FLAGS_PROFILING "-O0 -g -pg")
+SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -ggdb")
+SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -g")
+SET(CMAKE_CXX_FLAGS_CCOV "-O2 -g --coverage")
+
# Check for C++11 support and enable proper compilation flags
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
ENDIF()
ENDIF()
+IF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
+ ADD_DEFINITIONS("-DBUILD_TYPE_DEBUG")
+ENDIF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
+
SET(BIN_DIR
"${CMAKE_INSTALL_PREFIX}/bin"
CACHE PATH
cp -a %{SOURCE1002} .
%build
-%if 0%{?sec_build_binary_debug_enable}
+%if 0%{?sec_build_binary_debug_enable:1}
export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
%endif
+%if 0%{!?build_type:1}
+%define build_type RELEASE
+%endif
+
%if %{?build_type} == "DEBUG"
export CXXFLAGS="$CXXFLAGS -Wp,-U_FORTIFY_SOURCE"
%endif