[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: Packaging a cmake C++ header only library requiring C++17

From: Tobias Geerinckx-Rice
Subject: Re: Fwd: Packaging a cmake C++ header only library requiring C++17
Date: Fri, 29 Nov 2019 15:16:27 +0100



Josh Marshall 写道:
The problem which we can't figure out is why the compiler being used
is the default for `gcc` at 7.4 while there is explicit use and
dependency on `gcc` 9.2 via `gcc-9`.  We're stumped.

Well…  I'm easily stumped but that's actually not the case here.

You've added gcc-9 to ‘inputs’. If you rename your ‘inputs’ field to ‘native-inputs’ you'll the see the magic kick in:

 $ guix build -f magic_enum.scm
 g++ (GCC) 9.2.0
 Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


After removing the debugging ‘ --version’, it complains that:

cc1plus: error: command line option ?-std=gnu17? is valid for C/ObjC but not for C++ [-Werror]

True dat.  So I edit your code to read:

 #:configure-flags '("-DCMAKE_CXX_FLAGS=-std=c++17")

Note that there's no need for 'quotes' here. Guix doesn't pass command lines to a shell like many other build systems.

Et pouf!

 $ guix build -f magic_enum.scm

$ tree /gnu/store/h9npwdihnwr11xdbqjr20q5w2r6dbw1x-magic-enum-0.6.3
 ├── include
 │   └── magic_enum.hpp
 ├── lib
 │   └── cmake
 │       └── magic_enum
 │           ├── magic_enumConfig.cmake
 │           └── magic_enumConfigVersion.cmake
 └── share
     └── doc
         └── magic-enum-0.6.3
             └── LICENSE


Resending because I didn't get a post acknowledgement.

I don't think (first) posts are explicitly acknowledged. The mailing lists are sometimes delayed (seldom more than a few minutes). The Web archives have a similar but often longer delay.

nckd and I have gone back and forth over a few days in IRC

Close ;-) I know, weird nick, see my real name for an explanation.

Kind regards,


Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]