trompeloeil icon indicating copy to clipboard operation
trompeloeil copied to clipboard

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

Open AndrewPaxie opened this issue 5 years ago • 4 comments

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 avatar Sep 27 '20 03:09 AndrewPaxie

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 avatar Sep 20 '21 07:09 AndrewPaxie

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.

AndrewPaxie avatar Nov 14 '21 04:11 AndrewPaxie

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 avatar Nov 14 '21 07:11 rollbear

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.

rollbear avatar Nov 15 '21 15:11 rollbear