quiet / libcorrect

C library for Convolutional codes and Reed-Solomon
BSD 3-Clause "New" or "Revised" License
362 stars 95 forks source link

CMakeLists.txt: fixes for various toolchains #22

Closed JoelsonCarl closed 5 years ago

JoelsonCarl commented 5 years ago

Hello. I was going to add libcorrect as a selectable package in buildroot, but I ran into some issues when I ran it against buildroot's tests (which compiles the package using a variety of toolchains with different capabilities/architectures). To get libcorrect to compile correctly for as many of the toolchains as I could, I did the following:

  1. In the Debug build, remove -march=native. Some toolchains may not support this option and it is not necessary.
  2. Specify C as the project language since there is no C++ code. This allows toolchains lacking C++ support to build the library.
  3. Switch check_cxx_source_compiles to check_c_source_compiles, also for removing dependency on C++.

The one I'm most unsure about is the removal of -march=native. I don't know why the Debug build would need to specify that, and with my builds it seemed to be fine without. But maybe there's something I'm not aware of.

brian-armstrong commented 5 years ago

Thanks for the patch!

I can't remember why that -march=native was put there. My guess is that it was part of an attempt to tune performance, but it should be safe to remove.