Quantcast

Putting quotes around compiler option

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Putting quotes around compiler option

Boost - Build mailing list
Is there any way I can force Boost Build to pass a compiler option with
quotes ( " ) around the option when I specify the compiler option in a
jam file ?

As an example:

using some_toolset : some_version : some_command
  :
  <cxxflags>-fmacro-backtrace-limit=0
  ;

When passed to some_command I want -fmacro-backtrace-limit=0 passed as
"-fmacro-backtrace-limit=0".

Is this possible ?

Even if I specify:

using some_toolset : some_version : some_command
  :
  <cxxflags>"-fmacro-backtrace-limit=0"
  ;

using -d2 tells me that it is being passed as -fmacro-backtrace-limit=0
and not "-fmacro-backtrace-limit=0".

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

Re: Putting quotes around compiler option

Boost - Build mailing list
AMDG

On 05/06/2017 12:14 PM, Edward Diener via Boost-build wrote:
> Is there any way I can force Boost Build to pass a compiler option with
> quotes ( " ) around the option when I specify the compiler option in a
> jam file ?
>

Jam parses quotes.  You need to escape them with '\'.

In Christ,
Steven Watanabe

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

Re: Putting quotes around compiler option

Boost - Build mailing list
On 5/6/2017 2:19 PM, Steven Watanabe via Boost-build wrote:
> AMDG
>
> On 05/06/2017 12:14 PM, Edward Diener via Boost-build wrote:
>> Is there any way I can force Boost Build to pass a compiler option with
>> quotes ( " ) around the option when I specify the compiler option in a
>> jam file ?
>>
>
> Jam parses quotes.  You need to escape them with '\'.

Thanks, that worked. But unfortunately there are other options being
passed to the toolset, which I do not control via a bjam toolset
definition, which also need to be quoted.

The reason for quoting an option is that if I use as the compiler
command a windows batch file, which eventually invokes the compiler
command, all unquoted options which have an equal sign ( = ) are broken
into two separate options with the equal sign seen as a delimiter.

The solution as I see it is to use a python script rather than a Windows
batch file.

>
> In Christ,
> Steven Watanabe

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