From 541d1a3b705c5f7a7af72aa34c31adc91dbc3bdb Mon Sep 17 00:00:00 2001 From: Filip Grzywok Date: Sun, 24 Mar 2024 19:06:56 +0100 Subject: [PATCH] feat: Remove unnecessary portaudio include --- cspot/CMakeLists.txt | 2 +- flake.nix | 24 +++++++++++++----------- targets/cli/CMakeLists.txt | 8 +------- targets/cli/cmake/Findportaudio.cmake | 4 ---- 4 files changed, 15 insertions(+), 23 deletions(-) delete mode 100644 targets/cli/cmake/Findportaudio.cmake diff --git a/cspot/CMakeLists.txt b/cspot/CMakeLists.txt index a543c253..82c2b50f 100644 --- a/cspot/CMakeLists.txt +++ b/cspot/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.5) project(cspot) diff --git a/flake.nix b/flake.nix index d1868715..83f283c9 100644 --- a/flake.nix +++ b/flake.nix @@ -30,15 +30,7 @@ clang-tools = pkgs.clang-tools.override {llvmPackages = llvm;}; - apps = { - }; - - packages = { - target-cli = llvm.stdenv.mkDerivation { - name = "cspotcli"; - src = ./.; - cmakeFlags = ["-DCSPOT_TARGET_CLI=ON"]; - nativeBuildInputs = with pkgs; [ + deps = with pkgs; [ avahi avahi-compat cmake @@ -49,7 +41,17 @@ unstable.mbedtls portaudio protobuf - ]; + ]; + + apps = { + }; + + packages = { + target-cli = llvm.stdenv.mkDerivation { + name = "cspotcli"; + src = ./.; + cmakeFlags = ["-DCSPOT_TARGET_CLI=ON"]; + nativeBuildInputs = deps; # Patch nanopb shebangs to refer to provided python postPatch = '' patchShebangs cspot/bell/external/nanopb/generator/* @@ -60,7 +62,7 @@ devShells = { default = pkgs.mkShell { - packages = with pkgs; [cmake unstable.mbedtls ninja python3] ++ [clang-tools llvm.clang]; + packages = deps; }; }; in { diff --git a/targets/cli/CMakeLists.txt b/targets/cli/CMakeLists.txt index 17d2de9d..1e176d2c 100644 --- a/targets/cli/CMakeLists.txt +++ b/targets/cli/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.3) +cmake_minimum_required(VERSION 3.9) project(cspotcli) @@ -13,8 +13,6 @@ if(CMAKE_EXPORT_COMPILE_COMMANDS) ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}) endif() -set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) - # CMake options set(CMAKE_CXX_STANDARD 20) @@ -26,10 +24,6 @@ endif() # Main target sources file(GLOB SOURCES "*.cpp") -find_package(portaudio REQUIRED ) -include_directories( ${PORTAUDIO_INCLUDE_DIRS} ) -set(THINGS_TO_LINK ${THINGS_TO_LINK} ${PORTAUDIO_LIBRARIES}) - if(USE_PORTAUDIO) add_definitions(-DCSPOT_ENABLE_PORTAUDIO_SINK) set(BELL_SINK_PORTAUDIO ON) diff --git a/targets/cli/cmake/Findportaudio.cmake b/targets/cli/cmake/Findportaudio.cmake deleted file mode 100644 index f6fad845..00000000 --- a/targets/cli/cmake/Findportaudio.cmake +++ /dev/null @@ -1,4 +0,0 @@ -# PORTAUDIO_FOUND - system has libportaudio -# PORTAUDIO_INCLUDE_DIRS - the libportaudio include directory -# PORTAUDIO_LIBRARIES - Link these to use libportaudio -message(STATUS "DON'T USE THIS")