1cmake_minimum_required (VERSION 3.4)
2project (optee_client C)
3
4# https://cmake.org/Wiki/CMake_Useful_Variables
5set (CMAKE_TOOLCHAIN_FILE CMakeToolchain.txt)
6
7set (CFG_WERROR 1 CACHE BOOL "Build with -Werror")
8
9include(GNUInstallDirs)
10
11################################################################################
12# Compiler flags:
13#   We want to use the same flags in the entire optee_client git
14################################################################################
15add_compile_options (
16	-Wall -Wbad-function-cast -Wcast-align
17	-Werror-implicit-function-declaration -Wextra
18	-Wfloat-equal -Wformat-nonliteral -Wformat-security
19	-Wformat=2 -Winit-self -Wmissing-declarations
20	-Wmissing-format-attribute -Wmissing-include-dirs
21	-Wmissing-noreturn -Wmissing-prototypes -Wnested-externs
22	-Wpointer-arith -Wshadow -Wstrict-prototypes
23	-Wswitch-default -Wunsafe-loop-optimizations
24	-Wwrite-strings -fPIC
25)
26if(CFG_WERROR)
27    add_compile_options(-Werror)
28endif(CFG_WERROR)
29
30find_program(CCACHE_FOUND ccache)
31if(CCACHE_FOUND)
32    set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
33    set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
34endif(CCACHE_FOUND)
35
36add_subdirectory (libteec)
37add_subdirectory (tee-supplicant)
38add_subdirectory (public)
39add_subdirectory (libckteec)
40add_subdirectory (libseteec)
41