bjam: defining string literals HELP!!!!
hi, it would be really useful for me to be able to define a string literal in a Jamfile... eg: ===================================================== dll useful_variant : <template>useful src/modules/interpreter/useful_variant.cpp : # requirements <define>VARIANT <define>NAME="variant" ; ===================================================== gcc -DNAME=\"variant\" does what i want, so i've also tried <cxxflags>-DMODULENAME="variant" <cxxflags>"-DMODULENAME="variant"" <cxxflags>'-DMODULENAME="variant"' <cxxflags>"-DMODULENAME=\"variant\"" <cxxflags>"-DMODULENAME=\"\"variant\"\"" <cxxflags>"-DMODULENAME=""variant""" and various other hopeful monsters... but whatever i do, 'variant' appears in the source file as an identifier not a string. is it possible to achieve what i want with bjam??????????????????????????? cheers, and thanks in advance. Jono day-one.com
AMDG jono wrote:
it would be really useful for me to be able to define a string literal in a Jamfile...
<snip>
gcc -DNAME=\"variant\" does what i want, so i've also tried
<snip>
Think about what bjam does with the string. It behaves a lot like C++. In other words, you use a backslash as an escape character. You want to generate a \" sequence in the command line. Both of these are special characters, so they need to be escaped. <define>NAME=\\\"variant\\\" In Christ, Steven Watanabe
I believe you may be looking for something like this:
<toolset>msvc:<define>_MODULE_NAME_="\\\"MyModule.dll\\\""
<toolset>gcc:<define>_MODULE_NAME_="\\\"MyModule.so\\\""
Hope this helps,
Tim
On Wed, Jul 2, 2008 at 9:54 PM, Steven Watanabe
AMDG
jono wrote:
it would be really useful for me to be able to define a string literal in a Jamfile...
<snip>
gcc -DNAME=\"variant\" does what i want, so i've also tried
<snip>
Think about what bjam does with the string. It behaves a lot like C++. In other words, you use a backslash as an escape character. You want to generate a \" sequence in the command line. Both of these are special characters, so they need to be escaped.
<define>NAME=\\\"variant\\\"
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Regards, Timothy St. Clair [timothysc@gmail.com]
participants (3)
-
jono
-
Steven Watanabe
-
Tim St. Clair