Fix build break caused by toolchain upgrade
[platform/core/test/security-tests.git] / CMakeLists.txt
1 # Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved
2 #
3 #    Licensed under the Apache License, Version 2.0 (the "License");
4 #    you may not use this file except in compliance with the License.
5 #    You may obtain a copy of the License at
6 #
7 #        http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #    Unless required by applicable law or agreed to in writing, software
10 #    distributed under the License is distributed on an "AS IS" BASIS,
11 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #    See the License for the specific language governing permissions and
13 #    limitations under the License.
14 #
15 # @file        CMakeLists.txt
16 # @author      Bartlomiej Grzelewski (b.grzelewski@samsung.com)
17 # @author      Pawel Polawski (p.polawski@partner.samsung.com)
18 # @brief
19 #
20
21 ############################# Check minimum CMake version #####################
22
23 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
24 PROJECT("security-tests")
25
26 ############################# cmake packages ##################################
27
28 INCLUDE(FindPkgConfig)
29
30 ############################# compilation defines #############################
31
32 # If supported for the target machine, emit position-independent code,suitable
33 # for dynamic linking and avoiding any limit on the size of the global offset
34 # table. This option makes a difference on the m68k, PowerPC and SPARC.
35 # (BJ: our ARM too?)
36 ADD_DEFINITIONS("-fPIC")
37
38 # Set the default ELF image symbol visibility to hidden - all symbols will be
39 # marked with this unless overridden within the code.
40 #ADD_DEFINITIONS("-fvisibility=hidden")
41 ADD_DEFINITIONS("-Werror")                      # Make all warnings into errors.
42 ADD_DEFINITIONS("-Wall")                        # Generate all warnings
43 ADD_DEFINITIONS("-Wextra")                      # Generate even more extra warnings
44 ADD_DEFINITIONS("-Wno-variadic-macros")         # Inhibit variadic macros warnings (needed for ORM)
45 ADD_DEFINITIONS("-Wno-deprecated")               # No warnings about deprecated features
46 ADD_DEFINITIONS("-Wno-deprecated-declarations")               # No warnings about deprecated features
47
48 ############################# compiler flags ##################################
49
50 SET(CMAKE_C_FLAGS              "-g")
51 SET(CMAKE_CXX_FLAGS            "-g -std=c++0x")
52 SET(CMAKE_C_FLAGS_PROFILING    "-O0 -pg")
53 SET(CMAKE_CXX_FLAGS_PROFILING  "-O0 -pg -std=c++0x")
54 SET(CMAKE_C_FLAGS_DEBUG        "-O0 -ggdb")
55 SET(CMAKE_CXX_FLAGS_DEBUG      "-O0 -ggdb -std=c++0x")
56 SET(CMAKE_C_FLAGS_RELEASE      "-O2")
57 SET(CMAKE_CXX_FLAGS_RELEASE    "-O2 -std=c++0x")
58
59 SET(SMACK_ENABLE ON)
60
61 OPTION(DPL_LOG "DPL logs status" ON)
62 IF(DPL_LOG)
63     MESSAGE(STATUS "Logging enabled for DPL")
64     ADD_DEFINITIONS("-DDPL_LOGS_ENABLED")
65 ELSE(DPL_LOG)
66     MESSAGE(STATUS "Logging disabled for DPL")
67 ENDIF(DPL_LOG)
68
69 IF(SMACK_ENABLE)
70     ADD_DEFINITIONS("-DWRT_SMACK_ENABLED")
71 ENDIF(SMACK_ENABLE)
72
73 ############################# Targets names ###################################
74
75 SET(DPL_FRAMEWORK_TEST_LIBRARY "dpl-test-framework")
76 SET(COMMON_TARGET_TEST "tests-common")
77
78 SET(TARGET_AFP_TESTS "auth-fw-passwd-tests")
79
80 ############################# subdirectories ##################################
81
82 ADD_SUBDIRECTORY(src)
83 ADD_SUBDIRECTORY(tests)