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 libafbwsc)
20 pkg_check_modules(SD REQUIRED libsystemd>=222)
22 add_library(afbclient SHARED
26 target_include_directories(afbclient
31 target_link_libraries(afbclient
36 target_compile_definitions(afbclient
38 _GNU_SOURCE) # XXX should I define this here?!
40 if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Release")
41 target_compile_definitions(afbclient
46 target_compile_options(afbclient
48 -Wall -Wextra -Wno-unused-parameter -Wno-comment)
50 set_target_properties(afbclient
52 # INTERPROCEDURAL_OPTIMIZATION ON
55 CXX_STANDARD_REQUIRED ON)
58 set_target_properties(afbclient
63 if (NOT ${SANITIZER_MODE} STREQUAL "none" AND NOT ${SANITIZER_MODE} STREQUAL "")
64 target_compile_options(afbclient
66 -fsanitize=${SANITIZER_MODE} -g -fno-omit-frame-pointer)
67 set_target_properties(afbclient
69 LINK_FLAGS "-fsanitize=${SANITIZER_MODE} -g")
74 DESTINATION ${CMAKE_INSTALL_LIBDIR}
79 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
80 COMPONENT "development")