summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: 98b526f3ceb0688fd484e49a8713d68c4f80acde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
project(pulseaudio-module-4a C)

cmake_minimum_required(VERSION 2.8.8)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(PROJECT_NAME "Pulseaudio Module 4A")
set(PROJECT_VERSION "0.1")

find_package(PkgConfig)
include(GNUInstallDirs)

###########################################################################

add_compile_options(-Wall -Wextra -Wconversion)
add_compile_options(-Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable)
add_compile_options(-Wno-parentheses)
add_compile_options(-Wno-sign-compare -Wno-sign-conversion)
add_compile_options(-Werror=maybe-uninitialized)
add_compile_options(-Werror=implicit-function-declaration)
add_compile_options(-ffunction-sections -fdata-sections)

###########################################################################

pkg_check_modules(dependencies REQUIRED libafbwsc libsystemd json-c pulseaudio-module-devel)
pkg_get_variable(plugin_install_dir pulseaudio-module-devel modlibexecdir)

add_definitions(${dependencies_CFLAGS})
include_directories(${dependencies_INCLUDE_DIRS})
string(REGEX REPLACE ";" " " dep_link_flags "${dependencies_LDFLAGS}" "")
set(link_flags "${dep_link_flags} -Wl,-rpath=${plugin_install_dir} -Wl,--as-needed -Wl,--gc-sections")

############################################################

add_library(module-4a-client MODULE module-4a-client.c m4a_afb_comm.c)
target_link_libraries(module-4a-client ${dependencies_LIBRARIES})
set_target_properties(module-4a-client PROPERTIES PREFIX ""
                                       LINK_FLAGS "${link_flags}")

install(TARGETS module-4a-client
        DESTINATION ${plugin_install_dir})