Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMakeLists.txt: fixes for various toolchains #22

Merged
merged 1 commit into from
Oct 9, 2018

Conversation

JoelsonCarl
Copy link
Contributor

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.

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++.

Signed-off-by: Joel Carlson <JoelsonCarl@gmail.com>
@brian-armstrong
Copy link
Member

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.

@brian-armstrong brian-armstrong merged commit ce6c17f into quiet:master Oct 9, 2018
@JoelsonCarl JoelsonCarl deleted the various-toolchain-fixes branch October 9, 2018 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants