diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..22584b1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,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 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}) |