2 # Copyright (C) 2017 Mentor Graphics Development (Deutschland) GmbH
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
17 include(FindPkgConfig)
19 pkg_check_modules(AFB REQUIRED afb-daemon)
20 pkg_check_modules(SD REQUIRED libsystemd>=222)
22 add_library(afbclient SHARED
26 target_include_directories(afbclient
31 target_link_libraries(afbclient
37 target_compile_definitions(afbclient
39 _GNU_SOURCE) # XXX should I define this here?!
41 if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Release")
42 target_compile_definitions(afbclient
47 target_compile_options(afbclient
49 -Wall -Wextra -Wno-unused-parameter -Wno-comment)
51 set_target_properties(afbclient
53 # INTERPROCEDURAL_OPTIMIZATION ON
56 CXX_STANDARD_REQUIRED ON)
59 set_target_properties(afbclient
64 if (NOT ${SANITIZER_MODE} STREQUAL "none" AND NOT ${SANITIZER_MODE} STREQUAL "")
65 target_compile_options(afbclient
67 -fsanitize=${SANITIZER_MODE} -g -fno-omit-frame-pointer)
68 set_target_properties(afbclient
70 LINK_FLAGS "-fsanitize=${SANITIZER_MODE} -g")