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

Can not choose clang version on FreeBSD #723

Open
fasxmut opened this issue May 2, 2021 · 2 comments
Open

Can not choose clang version on FreeBSD #723

fasxmut opened this issue May 2, 2021 · 2 comments
Labels
transition Transition to bfgroup/b2

Comments

@fasxmut
Copy link

fasxmut commented May 2, 2021

Commonly there are several different versions of clang installed on the FreeBSD system, but b2 seems can only use the default clang:

This works:
b2 toolset=clang

This works:
using clang ;

But these all fail:
b2 toolset=clang10
b2 toolset=clang-10
b2 toolset=clang11
b2 toolset=clang-11
b2 toolset=clang-devel

using clang : 10 ;

using clang : 11 ;

using clang : devel ;

It just can not use alt clang except the default.
If I try them and find,
b2 toolset=clang-11 -n
gives me screen information that it still invokes clang++,
the real c++ compiler command should be clang++11

@fasxmut
Copy link
Author

fasxmut commented May 4, 2021

After two days I have to reply my own question, because I got the answer by myself.
When I read toolset.jam and clang.jam I got a bunch of arg variables $(2), $(3), ..., $(9), they are not so easy to understand whats the meaning. But Finally I got something. There is a way but it is not perfect, write it at the top of the project Jamfile :

using clang : 11 : clang++11 ;

The second arg (11) passed to using can be anything, but do not include dash - , and the extra fourth args can be used:

using clang : 11 : clang++11 : <cxxflags>-std=c++20 ;
using clang : 10 : clang++10 ;

Here it is ok to only type command b2, but command b2 toolset=clang-11 will cause it to report duplicate error.

@stale
Copy link

stale bot commented May 29, 2021

Thank you for your contributions. Main development of B2 has moved to https://github.com/bfgroup/b2
This issue has been automatically marked as "transition" to indicate the potential for needing transition to the new B2 development project.

@stale stale bot added the transition Transition to bfgroup/b2 label May 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
transition Transition to bfgroup/b2
Projects
None yet
Development

No branches or pull requests

1 participant