berndporr / iir1

DSP IIR realtime filter library written in C++

Home Page:http://berndporr.github.io/iir1/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Demo Compile Issues on Windows when using FetchContent (#include <sys/time.h>)

epezent opened this issue · comments

The new file benchmark.cpp is causing compile issues on Windows (MSVC) for me when using CMake's FetchContent feature. The culprit is the inclusion of <sys/time.h>. To workaround the issue, I disable the compilation of the demo apps in a rather hackish way:

FetchContent_Declare(iir GIT_REPOSITORY https://github.com/berndporr/iir1) 
FetchContent_MakeAvailable(iir)
set_target_properties(iirdemo ecg50hzfilt benchmark PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)

To address this, can you either:

  1. ensure that the demos are cross-platform, OR
  2. disable demo compilation in CMake if WIN32, OR
  3. add an option to disable demo compilation with CMake so that it can be disabled with FetchContent in a clean manner, e.g.:
set(IIR_BUILD_DEMOS OFF CACHE BOOL "" FORCE)
FetchContent_Declare(iir GIT_REPOSITORY https://github.com/berndporr/iir1) 
FetchContent_MakeAvailable(iir)

BOTH 1 and 3 would be the best option.

Thanks!

Hi,
thanks for the bug report that it's not cross platform. If you use the iir libary with Fetch Content I strongly recommend to fetch a release as the main repo might not compile. Either way thanks for the feedback. I've removed the benchmark file as it was just there to test how the header based inlines and new C11 features improve performance. And they do so I've removed it again.
/Bernd