conf.d/cmake/config.cmake: Fail on warnings
[apps/agl-service-homescreen.git] / conf.d / cmake / config.cmake
1 ###########################################################################
2 # Copyright 2015-2020 IoT.bzh
3 # Copyright (C) 2020 Konsulko Group
4 #
5 # author: Marec Frédéric <frederic.marec@iot.bzh>
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #     http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 ###########################################################################
19
20 # Project Info
21 # ------------------
22 set(PROJECT_NAME "agl-service-homescreen")
23 set(API_NAME "homescreen")
24 set(PROJECT_PRETTY_NAME "HomeScreen Service")
25 set(PROJECT_DESCRIPTION "HomeScreen Binding Service")
26 set(PROJECT_URL "https://gerrit.automotivelinux.org/gerrit/apps/agl-service-homescreen")
27 set(PROJECT_ICON "icon.svg")
28 set(PROJECT_AUTHOR "TOYOTA")
29 set(PROJECT_AUTHOR_EMAIL "")
30 set(PROJECT_VERSION "0.1")
31 set(PROJECT_LICENSE "APL2.0")
32 set(PROJECT_LANGUAGES,"CXX")
33
34 # Which directories inspect to find CMakeLists.txt target files
35 # set(PROJECT_SRC_DIR_PATTERN "*")
36
37 # Where are stored the project configuration files
38 # relative to the root project directory
39 set(PROJECT_CMAKE_CONF_DIR "conf.d")
40
41 # Compilation Mode (DEBUG, RELEASE, COVERAGE or PROFILING)
42 # ----------------------------------
43 set(BUILD_TYPE "RELEASE")
44 #set(USE_EFENCE 1)
45
46 # Kernel selection if needed. You can choose between a
47 # mandatory version to impose a minimal version.
48 # Or check Kernel minimal version and just print a Warning
49 # about missing features and define a preprocessor variable
50 # to be used as preprocessor condition in code to disable
51 # incompatibles features. Preprocessor define is named
52 # KERNEL_MINIMAL_VERSION_OK.
53 #
54 # NOTE*** FOR NOW IT CHECKS KERNEL Yocto environment and
55 # Yocto SDK Kernel version.
56 # -----------------------------------------------
57 #set (kernel_mandatory_version 4.8)
58 #set (kernel_minimal_version 4.8)
59
60 # Compiler selection if needed. Impose a minimal version.
61 # -----------------------------------------------
62 set (gcc_minimal_version 4.9)
63
64 # PKG_CONFIG required packages
65 # -----------------------------
66 set (PKG_REQUIRED_LIST
67         json-c
68         afb-daemon
69 )
70
71 # You can also consider to include libsystemd
72 # -----------------------------------
73 #list (APPEND PKG_REQUIRED_LIST libsystemd>=222)
74
75 # Prefix path where will be installed the files
76 # Default: /usr/local (need root permission to write in)
77 # ------------------------------------------------------
78 #set(INSTALL_PREFIX /opt/AGL CACHE PATH "INSTALL PREFIX PATH")
79
80 # Customize link option
81 # -----------------------------
82 list (APPEND link_libraries -pthread)
83
84 # Compilation options definition
85 # Use CMake generator expressions to specify only for a specific language
86 # Values are prefilled with default options that is currently used.
87 # Either separate options with ";", or each options must be quoted separately
88 # DO NOT PUT ALL OPTION QUOTED AT ONCE , COMPILATION COULD FAILED !
89 # ----------------------------------------------------------------------------
90 set(COMPILE_OPTIONS
91  -Wall
92  -Wextra
93  -Werror
94  -Wno-cpp
95  -Wno-missing-field-initializers
96  -fstack-protector-all
97  -Wl,-z,relro,-z,now
98  CACHE STRING "Compilation flags"
99 )
100 #set(COMPILE_OPTIONS
101 # -Wall
102 # -Wextra
103 # -Wconversion
104 # -Wno-unused-parameter
105 # -Wno-sign-compare
106 # -Wno-sign-conversion
107 # -Werror=maybe-uninitialized
108 # -Werror=implicit-function-declaration
109 # -ffunction-sections
110 # -fdata-sections
111 # -fPIC
112 # CACHE STRING "Compilation flags")
113 #set(C_COMPILE_OPTIONS "" CACHE STRING "Compilation flags for C language.")
114 #set(CXX_COMPILE_OPTIONS "" CACHE STRING "Compilation flags for C++ language.")
115 #set(PROFILING_COMPILE_OPTIONS
116 # -g
117 # -O0
118 # -pg
119 # -Wp,-U_FORTIFY_SOURCE
120 # CACHE STRING "Compilation flags for PROFILING build type.")
121 #set(DEBUG_COMPILE_OPTIONS
122 # -g
123 # -ggdb
124 # CACHE STRING "Compilation flags for DEBUG build type.")
125 #set(COVERAGE_COMPILE_OPTIONS
126 # -g
127 # -O0
128 # --coverage
129 # CACHE STRING "Compilation flags for COVERAGE build type.")
130 #set(RELEASE_COMPILE_OPTIONS
131 # -O2
132 # -pipe
133 # -D_FORTIFY_SOURCE=2
134 # -fstack-protector-strong
135 # -Wformat -Wformat-security
136 # -Werror=format-security
137 # -feliminate-unused-debug-types
138 # -Wl,-O1
139 # -Wl,--hash-style=gnu
140 # -Wl,--as-needed
141 # -fstack-protector-strong
142 # -Wl,-z,relro,-z,now
143 # CACHE STRING "Compilation flags for RELEASE build type.")
144
145 # Location for config.xml.in template file.
146 #
147 # If you keep them commented then it will build with a default minimal widget
148 # template which is very simple and it is highly probable that it will not suit
149 # to your app.
150 # -----------------------------------------
151 set(WIDGET_CONFIG_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/conf.d/wgt/config.xml.in)
152
153 # Mandatory widget Mimetype specification of the main unit
154 # --------------------------------------------------------------------------
155 # Choose between :
156 #- text/html : HTML application,
157 #       content.src designates the home page of the application
158 #
159 #- application/vnd.agl.native : AGL compatible native,
160 #       content.src designates the relative path of the binary.
161 #
162 # - application/vnd.agl.service: AGL service, content.src is not used.
163 #
164 #- ***application/x-executable***: Native application,
165 #       content.src designates the relative path of the binary.
166 #       For such application, only security setup is made.
167 #
168 set(WIDGET_TYPE application/vnd.agl.service)
169
170 # Mandatory Widget entry point file of the main unit
171 # --------------------------------------------------------------
172 # This is the file that will be executed, loaded,
173 # at launch time by the application framework.
174 #
175 set(WIDGET_ENTRY_POINT lib/homescreen-binding.so)
176
177 # Optional dependencies order
178 # ---------------------------
179 #set(EXTRA_DEPENDENCIES_ORDER)
180
181 # Optional Extra global include path
182 # -----------------------------------
183 #set(EXTRA_INCLUDE_DIRS)
184
185 # Optional extra libraries
186 # -------------------------
187 #set(EXTRA_LINK_LIBRARIES)
188
189 # Optional force binding Linking flag
190 # ------------------------------------
191 # set(BINDINGS_LINK_FLAG LinkOptions )
192
193 # Optional force package prefix generation, like widget
194 # -----------------------------------------------------
195 # set(PKG_PREFIX DestinationPath)
196
197 # Optional Application Framework security token
198 # and port use for remote debugging.
199 #------------------------------------------------------------
200 set(AFB_TOKEN   ""     CACHE PATH "Default binder security token")
201 set(AFB_REMPORT "1234" CACHE PATH "Default binder listening port")
202
203 # Print a helper message when every thing is finished
204 # ----------------------------------------------------
205 set(CLOSING_MESSAGE "Typical binding launch: cd ${CMAKE_BINARY_DIR}/package \\&\\& afb-daemon --port=${AFB_REMPORT} --workdir=. --ldpaths=lib --roothttp=htdocs  --token=\"${AFB_TOKEN}\" --tracereq=common --verbose")
206 set(PACKAGE_MESSAGE "Install widget file using in the target : afm-util install ${PROJECT_NAME}.wgt")
207
208 # Optional schema validator about now only XML, LUA and JSON
209 # are supported
210 #------------------------------------------------------------
211 #set(LUA_CHECKER "luac" "-p" CACHE STRING "LUA compiler")
212 #set(XML_CHECKER "xmllint" CACHE STRING "XML linter")
213 #set(JSON_CHECKER "json_verify" CACHE STRING "JSON linter")
214
215 include(CMakeAfbTemplates)