How do I make a make target dependent on my compiler version?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I make a make target dependent on my compiler version?

Boost - Build mailing list
Hi,
I have executables with compiler specific features work, like below.

  exe myExe : src1.cc src2.cc : <toolset>gcc-6.0.0:<define>DEFINE1
  exe myExe : src1.cc src2.cc : <toolset>gcc-10.0.0:<define>DEFINE2

I'm trying to do the same with a make target but it's not working.

  make myMake : myExe : @user-config.link_install :
    <toolset>gcc-6.0.0:<define>DEFINE1
    <toolset>gcc-10.0.0:<define>DEFINE2

With these lines, I get "error: default build must be identical in all alternatives".

Why doesn't this work for make like it does for exe?

Thanks,
Uri

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: How do I make a make target dependent on my compiler version?

Boost - Build mailing list
On 10/29/2020 3:29 PM, Uri Moszkowicz via Boost-build wrote:

> Hi,
> I have executables with compiler specific features work, like below.
>
>    exe myExe : src1.cc src2.cc : <toolset>gcc-6.0.0:<define>DEFINE1
>    exe myExe : src1.cc src2.cc : <toolset>gcc-10.0.0:<define>DEFINE2
>
> I'm trying to do the same with a make target but it's not working.
>
>    make myMake : myExe : @user-config.link_install :
>      <toolset>gcc-6.0.0:<define>DEFINE1
>      <toolset>gcc-10.0.0:<define>DEFINE2
>
> With these lines, I get "error: default build must be identical in all
> alternatives".
>
> Why doesn't this work for make like it does for exe?

Maybe:

make myMake : myExe : @user-config.link_install :
       <toolset>gcc-6.0.0:<define>DEFINE1 ;

make myMake : myExe : @user-config.link_install :
       <toolset>gcc-10.0.0:<define>DEFINE2 ;

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build