| Joakim Bech | e0a12e2 | 2016-04-19 13:25:08 +0200 | [diff] [blame] | 1 | cmake_minimum_required (VERSION 3.4) |
| 2 | project (optee_client C) |
| 3 | |
| 4 | # https://cmake.org/Wiki/CMake_Useful_Variables |
| 5 | set (CMAKE_TOOLCHAIN_FILE CMakeToolchain.txt) |
| 6 | |
| Jerome Forissier | 5355fdb | 2018-07-06 10:32:53 +0200 | [diff] [blame] | 7 | set (CFG_WERROR 1 CACHE BOOL "Build with -Werror") |
| 8 | |
| Joakim Bech | e0a12e2 | 2016-04-19 13:25:08 +0200 | [diff] [blame] | 9 | include(GNUInstallDirs) |
| 10 | |
| 11 | ################################################################################ |
| 12 | # Compiler flags: |
| 13 | # We want to use the same flags in the entire optee_client git |
| 14 | ################################################################################ |
| 15 | add_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 |
| Jerome Forissier | 5355fdb | 2018-07-06 10:32:53 +0200 | [diff] [blame] | 24 | -Wwrite-strings -fPIC |
| Joakim Bech | e0a12e2 | 2016-04-19 13:25:08 +0200 | [diff] [blame] | 25 | ) |
| Jerome Forissier | 5355fdb | 2018-07-06 10:32:53 +0200 | [diff] [blame] | 26 | if(CFG_WERROR) |
| 27 | add_compile_options(-Werror) |
| 28 | endif(CFG_WERROR) |
| Joakim Bech | e0a12e2 | 2016-04-19 13:25:08 +0200 | [diff] [blame] | 29 | |
| 30 | find_program(CCACHE_FOUND ccache) |
| 31 | if(CCACHE_FOUND) |
| 32 | set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) |
| 33 | set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) |
| 34 | endif(CCACHE_FOUND) |
| 35 | |
| 36 | add_subdirectory (libteec) |
| 37 | add_subdirectory (tee-supplicant) |
| 38 | add_subdirectory (public) |
| Etienne Carriere | fa679fc | 2019-01-11 10:17:55 +0100 | [diff] [blame] | 39 | add_subdirectory (libckteec) |
| Jorge Ramirez-Ortiz | f4f54e5 | 2021-11-03 12:28:47 +0100 | [diff] [blame] | 40 | add_subdirectory (libseteec) |