Release 2.1.1
[platform/core/security/device-certificate-manager-backend.git] / CMakeLists.txt
1 # Copyright (c) 2017 - 2020 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      Pawel Kowalski <p.kowalski2@partner.samsung.com>
17 # @author      Jaroslaw Pelczar <j.pelczar@samsung.com>
18 #
19
20 CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
21
22 INCLUDE(GNUInstallDirs)
23 INCLUDE(CheckLibraryExists)
24
25 IF(NOT CMAKE_BUILD_TYPE)
26         SET(CMAKE_BUILD_TYPE "RELEASE")
27 ENDIF(NOT CMAKE_BUILD_TYPE)
28
29 SET(CMAKE_C_FLAGS_DEBUG        "-std=c11 -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
30 SET(CMAKE_CXX_FLAGS_DEBUG      "-std=c++17 -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
31 SET(CMAKE_C_FLAGS_RELEASE      "-std=c11 -O2 -DNDEBUG")
32 SET(CMAKE_CXX_FLAGS_RELEASE    "-std=c++17 -O2 -DNDEBUG")
33
34 ADD_DEFINITIONS("-Werror")
35 ADD_DEFINITIONS("-Wall")
36 ADD_DEFINITIONS("-Wextra")
37
38 SET(CMAKE_POSITION_INDEPENDENT_CODE "True")
39 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
40
41 ADD_SUBDIRECTORY(src/dummy-backend)