bjam define=_SECURE_SCL shows no effect

hi, after reading through this thread [1] i tried the following to build boost::program options: bjam define=_SECURE_SCL=0 define=_TESTING_SOMTHING=1 --toolset=msvc-8.0 --with-program_options variant=release to test the effect i added the folowing to the store function in program_options: #if _SECURE_SCL == 1 std::cout << "_SECURE_SCL == 1" << std::endl; #else std::cout << "_SECURE_SCL == 0" << std::endl; #endif #if _TESTING_SOMTHING == 1 std::cout << "_TESTING_SOMTHING == 1" << std::endl; #else std::cout << "_TESTING_SOMTHING == 0" << std::endl; #endif the strange thing now is, that _TESTING_SOMTHING is correctly set to 1 but _SECURE_SCL still is set to 1 and not to 0. did i miss something or is there another way to get this set properly to disable all runtime checks for release builds? [1] http://thread.gmane.org/gmane.comp.lib.boost.devel/143980/focus=144063 thx -chris -- Christopher Lux | | Bauhaus University Weimar | Faculty of Media - Virtual Reality Systems Group

Christopher Lux wrote:
hi, after reading through this thread [1] i tried the following to build boost::program options:
bjam define=_SECURE_SCL=0 define=_TESTING_SOMTHING=1 --toolset=msvc-8.0 --with-program_options variant=release
There's no such features as "define" http://boost.org/doc/html/bbv2/reference.html#bbv2.advanced.builtins.feature.... You probably want "cflags". -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo

On Mon, 21 May 2007 22:43:27 +0200, Rene Rivera
bjam define=_SECURE_SCL=0 define=_TESTING_SOMTHING=1 --toolset=msvc-8.0 --with-program_options variant=release
There's no such features as "define" http://boost.org/doc/html/bbv2/reference.html#bbv2.advanced.builtins.feature.... You probably want "cflags".
Hi, thanks for the hint, but unfortunately this brings up other problems. I tried now: bjam cxxflags=/D_SECURE_SCL=0 --toolset=msvc-8.0 --with-program_options variant=release Now i get the following error: D:/_devel/boost_1_34_0/tools/build/v2/build\property.jam:282: in validate1 from module property error: Invalid property '<cxxflags>': No value specified for feature 'cxxflags'. D:/_devel/boost_1_34_0/tools/build/v2/build\property.jam:290: in property.validate from module property D:/_devel/boost_1_34_0/tools/build/v2/build\build-request.jam:185: in convert-command-line-element from module build-request D:/_devel/boost_1_34_0/tools/build/v2/build\build-request.jam:143: in build-request.from-command-line from module build-request D:/_devel/boost_1_34_0/tools/build/v2\build-system.jam:265: in load from module build-system D:\_devel\boost_1_34_0\tools\build\v2/kernel\modules.jam:261: in import from module modules D:\_devel\boost_1_34_0\tools\build\v2/kernel/bootstrap.jam:132: in boost-build from module D:\_devel\boost_1_34_0\boost-build.jam:9: in module scope from module -chris -- Christopher Lux | | Bauhaus University Weimar | Faculty of Media - Virtual Reality Systems Group

Christopher Woods wrote:
Christopher Lux wrote:
bjam cxxflags=/D_SECURE_SCL=0 --toolset=msvc-8.0 --with-program_options variant=release
I think you have to use "-D" not "/D". It appears that "/" messes with bjam. See the "[build] disabling specific warnings thread".
HTH,
-Chris
Another note - I don't know if program_options has any other library dependencies but if it does then you'll have to rebuild those libraries as well. I think you might want a complete build of boost with the define. In order to have both the default build and the "unsafe" (used loosely) build then you'd want to specify a new ABI flag - though I'm not sure how you do that exactly. -Chris

On Mon, 21 May 2007 23:17:02 +0200, Christopher Woods
Christopher Lux wrote:
bjam cxxflags=/D_SECURE_SCL=0 --toolset=msvc-8.0 --with-program_options variant=release
I think you have to use "-D" not "/D". It appears that "/" messes with bjam. See the "[build] disabling specific warnings thread".
Hi, i tried that, but i does not work. I now solved it by editing the user-config.jam file: using msvc : 8.0_64 : : <cxxflags>/D_SECURE_SCL=0 ; which works ok. Now i only have to edit it for debug and release builds which is fine by me. Thanks for all the help! -chris -- Christopher Lux | | Bauhaus University Weimar | Faculty of Media - Virtual Reality Systems Group

Christopher Woods wrote:
Christopher Lux wrote:
bjam cxxflags=/D_SECURE_SCL=0 --toolset=msvc-8.0 --with-program_options variant=release
I think you have to use "-D" not "/D". It appears that "/" messes with bjam. See the "[build] disabling specific warnings thread".
On that thread I first said that using "-" instead of "/" works, and then corrected myself. It doesn't work, and I can't figure out how to make it work.

Yuval Ronen wrote:
Christopher Woods wrote:
Christopher Lux wrote:
bjam cxxflags=/D_SECURE_SCL=0 --toolset=msvc-8.0 --with-program_options variant=release
I think you have to use "-D" not "/D". It appears that "/" messes with bjam. See the "[build] disabling specific warnings thread".
On that thread I first said that using "-" instead of "/" works, and then corrected myself. It doesn't work, and I can't figure out how to make it work.
It appears that 'define=XXX' does not work, specifically when building Boost from top-level. Would you mind entering an issue in Trac (Boost Trac -- svn.boost.org, since this affects Boost proper), and assign it to me? - Volodya

Vladimir Prus wrote:
Yuval Ronen wrote:
Christopher Lux wrote:
bjam cxxflags=/D_SECURE_SCL=0 --toolset=msvc-8.0 --with-program_options variant=release I think you have to use "-D" not "/D". It appears that "/" messes with bjam. See the "[build] disabling specific warnings thread". On that thread I first said that using "-" instead of "/" works, and
Christopher Woods wrote: then corrected myself. It doesn't work, and I can't figure out how to make it work.
It appears that 'define=XXX' does not work, specifically when building Boost from top-level. Would you mind entering an issue in Trac (Boost Trac -- svn.boost.org, since this affects Boost proper), and assign it to me?
Well, you replied to a post where I'm talking about the cxxflags=/flag problem, and not about the define=MACRO problem (that was another post), but never mind, I opened tickets for both: http://svn.boost.org/trac/boost/ticket/984 http://svn.boost.org/trac/boost/ticket/985 I can't assign it to you, though. I have no Trac username, and I don't see any GUI for changing the assignee. Should those be marked as for 1.34.1 milestone?

Rene Rivera wrote:
Christopher Lux wrote:
hi, after reading through this thread [1] i tried the following to build boost::program options:
bjam define=_SECURE_SCL=0 define=_TESTING_SOMTHING=1 --toolset=msvc-8.0 --with-program_options variant=release
There's no such features as "define" http://boost.org/doc/html/bbv2/reference.html#bbv2.advanced.builtins.feature....
So does http://boost.org/doc/html/bbv2/tutorial.html#bbv2.tutorial.libs contain an error (note the line "bjam app optimization=full define=USE_ASM")?

Yuval Ronen wrote:
Rene Rivera wrote:
Christopher Lux wrote:
hi, after reading through this thread [1] i tried the following to build boost::program options:
bjam define=_SECURE_SCL=0 define=_TESTING_SOMTHING=1 --toolset=msvc-8.0 --with-program_options variant=release There's no such features as "define" http://boost.org/doc/html/bbv2/reference.html#bbv2.advanced.builtins.feature....
So does http://boost.org/doc/html/bbv2/tutorial.html#bbv2.tutorial.libs contain an error (note the line "bjam app optimization=full define=USE_ASM")?
I just checked... There is a "define", it's just not documented :-( -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com -- 102708583/icq - grafikrobot/aim - grafikrobot/yahoo

Rene Rivera wrote:
Yuval Ronen wrote:
Rene Rivera wrote:
Christopher Lux wrote:
hi, after reading through this thread [1] i tried the following to build boost::program options:
bjam define=_SECURE_SCL=0 define=_TESTING_SOMTHING=1 --toolset=msvc-8.0 --with-program_options variant=release There's no such features as "define" http://boost.org/doc/html/bbv2/reference.html#bbv2.advanced.builtins.feature.... So does http://boost.org/doc/html/bbv2/tutorial.html#bbv2.tutorial.libs contain an error (note the line "bjam app optimization=full define=USE_ASM")?
I just checked... There is a "define", it's just not documented :-(
And not working, as the OP said, and I can confirm...

Yuval Ronen wrote:
Rene Rivera wrote:
Yuval Ronen wrote:
Rene Rivera wrote:
Christopher Lux wrote:
hi, after reading through this thread [1] i tried the following to build boost::program options:
bjam define=_SECURE_SCL=0 define=_TESTING_SOMTHING=1 --toolset=msvc-8.0 --with-program_options variant=release There's no such features as "define" http://boost.org/doc/html/bbv2/reference.html#bbv2.advanced.builtins.feature.... So does http://boost.org/doc/html/bbv2/tutorial.html#bbv2.tutorial.libs contain an error (note the line "bjam app optimization=full define=USE_ASM")?
I just checked... There is a "define", it's just not documented :-(
And not working, as the OP said, and I can confirm...
I'm using e.g. <toolset>msvc-8.0:<define>_SCL_SECURE_NO_DEPRECATE within Jamfiles without a problem, so the feature exists. Never tried to use it from the command-line though. / Johan

Johan Nilsson wrote:
Yuval Ronen wrote:
Rene Rivera wrote:
Yuval Ronen wrote:
Rene Rivera wrote:
Christopher Lux wrote:
hi, after reading through this thread [1] i tried the following to build boost::program options:
bjam define=_SECURE_SCL=0 define=_TESTING_SOMTHING=1 --toolset=msvc-8.0 --with-program_options variant=release There's no such features as "define" http://boost.org/doc/html/bbv2/reference.html#bbv2.advanced.builtins.feature.... So does http://boost.org/doc/html/bbv2/tutorial.html#bbv2.tutorial.libs contain an error (note the line "bjam app optimization=full define=USE_ASM")? I just checked... There is a "define", it's just not documented :-( And not working, as the OP said, and I can confirm...
I'm using e.g. <toolset>msvc-8.0:<define>_SCL_SECURE_NO_DEPRECATE within Jamfiles without a problem, so the feature exists. Never tried to use it from the command-line though.
Right. To be accurate, it's the bjam command line that I've checked and doesn't work.

Rene Rivera skrev:
Christopher Lux wrote:
hi, after reading through this thread [1] i tried the following to build boost::program options:
bjam define=_SECURE_SCL=0 define=_TESTING_SOMTHING=1 --toolset=msvc-8.0 --with-program_options variant=release
There's no such features as "define" http://boost.org/doc/html/bbv2/reference.html#bbv2.advanced.builtins.feature.... You probably want "cflags".
Does bjam warn if one puts arguments there that it does not support? -Thorsten

on Tue May 22 2007, Thorsten Ottosen
Rene Rivera skrev:
Christopher Lux wrote:
hi, after reading through this thread [1] i tried the following to build boost::program options:
bjam define=_SECURE_SCL=0 define=_TESTING_SOMTHING=1 --toolset=msvc-8.0 --with-program_options variant=release
There's no such features as "define" http://boost.org/doc/html/bbv2/reference.html#bbv2.advanced.builtins.feature.... You probably want "cflags".
Does bjam warn if one puts arguments there that it does not support?
No -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

David Abrahams wrote:
on Tue May 22 2007, Thorsten Ottosen
wrote: Rene Rivera skrev:
Christopher Lux wrote:
hi, after reading through this thread [1] i tried the following to build boost::program options:
bjam define=_SECURE_SCL=0 define=_TESTING_SOMTHING=1 --toolset=msvc-8.0 --with-program_options variant=release
There's no such features as "define" http://boost.org/doc/html/bbv2/reference.html#bbv2.advanced.builtins.feature.... You probably want "cflags".
Does bjam warn if one puts arguments there that it does not support?
No
Heh? $ bjam foo=bar /home/ghost/Work/Boost/boost/tools/build/v2/build/property.jam:282: in validate1 from module property error: Invalid property '<foo>bar': unknown feature 'foo'. - Volodya

on Tue May 22 2007, Vladimir Prus
David Abrahams wrote:
on Tue May 22 2007, Thorsten Ottosen
wrote: Rene Rivera skrev:
Christopher Lux wrote:
hi, after reading through this thread [1] i tried the following to build boost::program options:
bjam define=_SECURE_SCL=0 define=_TESTING_SOMTHING=1 --toolset=msvc-8.0 --with-program_options variant=release
There's no such features as "define" http://boost.org/doc/html/bbv2/reference.html#bbv2.advanced.builtins.feature.... You probably want "cflags".
Does bjam warn if one puts arguments there that it does not support?
No
Heh?
$ bjam foo=bar /home/ghost/Work/Boost/boost/tools/build/v2/build/property.jam:282: in validate1 from module property error: Invalid property '<foo>bar': unknown feature 'foo'.
OK, it warns as long as the property doesn't start with '-' or the part after '=' doesn't start with '/' -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

David Abrahams wrote:
on Tue May 22 2007, Vladimir Prus
wrote: David Abrahams wrote:
on Tue May 22 2007, Thorsten Ottosen
wrote: Rene Rivera skrev:
Christopher Lux wrote:
hi, after reading through this thread [1] i tried the following to build boost::program options:
bjam define=_SECURE_SCL=0 define=_TESTING_SOMTHING=1 --toolset=msvc-8.0 --with-program_options variant=release
There's no such features as "define" http://boost.org/doc/html/bbv2/reference.html#bbv2.advanced.builtins.feature.... You probably want "cflags".
Does bjam warn if one puts arguments there that it does not support?
No
Heh?
$ bjam foo=bar /home/ghost/Work/Boost/boost/tools/build/v2/build/property.jam:282: in validate1 from module property error: Invalid property '<foo>bar': unknown feature 'foo'.
OK, it warns as long as the property doesn't start with '-'
What do you mean? Property can never start with '-'
or the part after '=' doesn't start with '/'
I shall look into that. Note that "/" has special significance in build request, per docs, but we probably can improve diagnostics. - Volodya

on Wed May 23 2007, Vladimir Prus
David Abrahams wrote:
on Tue May 22 2007, Vladimir Prus
wrote: David Abrahams wrote:
on Tue May 22 2007, Thorsten Ottosen
wrote: Rene Rivera skrev:
Christopher Lux wrote: > hi, after reading through this thread [1] i tried the following to > build boost::program options: > > bjam define=_SECURE_SCL=0 define=_TESTING_SOMTHING=1 > --toolset=msvc-8.0 --with-program_options variant=release
There's no such features as "define" http://boost.org/doc/html/bbv2/reference.html#bbv2.advanced.builtins.feature.... You probably want "cflags".
Does bjam warn if one puts arguments there that it does not support?
No
Heh?
$ bjam foo=bar /home/ghost/Work/Boost/boost/tools/build/v2/build/property.jam:282: in validate1 from module property error: Invalid property '<foo>bar': unknown feature 'foo'.
OK, it warns as long as the property doesn't start with '-'
What do you mean? Property can never start with '-'
I meant "argument," not "property."
or the part after '=' doesn't start with '/'
I shall look into that. Note that "/" has special significance in build request, per docs, but we probably can improve diagnostics.
Yeah, but having no way to escape a character with special significance is really bad. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com
participants (8)
-
Christopher Lux
-
Christopher Woods
-
David Abrahams
-
Johan Nilsson
-
Rene Rivera
-
Thorsten Ottosen
-
Vladimir Prus
-
Yuval Ronen