pothosware / SoapyAirspy

Soapy SDR plugin for the Airspy
https://github.com/pothosware/SoapyAirspy/wiki
MIT License
25 stars 13 forks source link

Fix cmake and compiler warnings #29

Closed zuckschwerdt closed 2 months ago

zuckschwerdt commented 3 months ago

This fixes the cmake warning about mismatched case in package search, proper case should be LibAIRSPY.

CMake Warning (dev) at FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (PkgConfig)
  does not match the name of the calling package (LibAIRSPY).  This can lead
  to problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  FindPkgConfig.cmake:99 (find_package_handle_standard_args)
  FindLibAIRSPY.cmake:1 (INCLUDE)
  CMakeLists.txt:16 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

Also uses REQUIRED on find_package(LibAIRSPY) to get explicit error messages instead of failing implicitly later on.

-- Checking for module 'libairspy'
--   No package 'libairspy' found
CMake Error at FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find LibAIRSPY (missing: LibAIRSPY_LIBRARIES
  LibAIRSPY_INCLUDE_DIRS)

(Note the mention of LibAIRSPY_LIBRARIES and LibAIRSPY_INCLUDE_DIRS, case does matter for e.g. build scripts.)

Adds Clang compatibility for compiler options. Bumps to a minimum of cmake 2.8.12 (Oct 2013) so we can use add_compile_options to proper order -Wall -Wextra vs -Wno-unused-parameter which add_definitions won't do. This gets rid of all the warning: unused parameter 'foo' [-Wunused-parameter]

zuckschwerdt commented 2 months ago

@guruofquality is it okay if I touch up the cmake build like this, possibly in other modules as well?

I might later add a Github Action to check PRs and report build warnings to contributors.

guruofquality commented 2 months ago

@guruofquality is it okay if I touch up the cmake build like this, possibly in other modules as well?

I might later add a Github Action to check PRs and report build warnings to contributors.

oh totally, that sounds great :100: