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

Extend cmake script to allow use of libc++ with g++ #207

Open
AndrewPaxie opened this issue Sep 27, 2020 · 4 comments
Open

Extend cmake script to allow use of libc++ with g++ #207

AndrewPaxie opened this issue Sep 27, 2020 · 4 comments
Assignees

Comments

@AndrewPaxie
Copy link
Collaborator

Add to CMakeLists.txt the capability for g++ compilers to
use libc++ as the standard library in a build configuration.

Provide one configuration that exercises this build configuration.
Suggestion: g++-9 -std=c++17 libc++ .

Rework the clang++-8 configurations that already use libc++
to use the new command line definition CXX_STDLIB instead
of co-opting CXXFLAGS.

@AndrewPaxie AndrewPaxie self-assigned this Sep 27, 2020
@AndrewPaxie
Copy link
Collaborator Author

Time to look at this in detail. As an update to the issue comment, it would be easier to consider just g++-11 in the first instance, and rework the steps "Install libc++" and Configure to handle the GCC case. Earlier versions of GCC may then follow. Until there is a build solution for versions prior to GCC 7, that version would mark a cutoff point for initial support of GCC and libc++.

@AndrewPaxie
Copy link
Collaborator Author

Started branch AndrewPaxie/trompeloeil/issue_207 and moved -fno-omit-frame-pointer to CMakeLists.txt from ci.yml. Long term goal is to have no compiler or linker flags specified in ci.yml. This will make the cmake script the master of the details of build configuration.

Next step: Bring up g++-11/*/libc++ build configurations.

@rollbear
Copy link
Owner

Hmm, are you sure that is the right way to go? The CMakeLists.txt file may be used by clients who do not wish to be bothered with our CI setup. I do not claim to be a CMake guru, by any means, but my understanding from those who are, is that you should avoid having compiler flags in your CMakeLists.txt files. I guess one alternative could be to create a collection of toolchain files that is referenced by ci.yml when setting up the different configurations. I'll try to dig for information on best practices for this.

@rollbear
Copy link
Owner

So, I have asked around, and everybody says "Use CMake toolchain file for this". A few specified "toolchain files for the general compiler setup, and then CMake presets for the details". I know nothing about CMake presets, but it may be worth looking into.

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

No branches or pull requests

2 participants