Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 765059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:49:42+00:00 2026-05-14T16:49:42+00:00

I’ve tried reading the documentation but it is rather impenetrable so I’m hoping someone

  • 0

I’ve tried reading the documentation but it is rather impenetrable so I’m hoping someone may have a simple answer. I want to define a new ‘variant’, based on ‘debug’, which just adds some macro definitions to the compiler command line, eg “-DSOMEMACRO”. I think I may be able to do this as a “sub-variant” of debug, or else just define a new variant copying ‘debug’, but I’m not even sure where to do this. It looks like feature.jam in $BOOST_BUILD_DIR/build may be the place. Perhaps what I really want is simply a new ‘feature’ but it’s still not clear to me exactly what I need to do and where, and I don’t know if a ‘feature’ allows me to direct the build products to a different directory to the ‘debug’ build.

Any suggestions will be appreciated. (In case you’re wondering, I have to use bjam since it has been adopted as our corporate standard.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T16:49:42+00:00Added an answer on May 14, 2026 at 4:49 pm

    I’m not quite sure what you want, but there’s a number of possibilities.

    A. You always want to compile with the SOMEMACRO macro defined. In which case, in the Jamfile for your project add

    project
      : requirements # These are requirements for this project
          # If compiling debug, define SOMEMACRO
          <variant>debug:<define>SOMEMACRO
      : usage-requirements
          # These are requirements projects using this project must have
          <variant>debug:<define>SOMEMACRO
      ;
    

    If you need SOMEMACRO always defined, you can remove the <variant>debug: condition. If you need to set other flags you can use <cflags>, <cxxflags>, and <linkflags> as appropriate.

    B. You want a quick switch to turn on your flags/define, perhaps by default, perhaps not, and builds with it on are not compatible with builds with it off. In which case you want a feature.

    import feature ;
    feature.feature steves-feature : off on
      : composite propagated link-incompatible ;
    feature.compose <steves-feature>on : <define>SOMEMACRO ;
    

    The feature.feature rule defines a feature called <steves-feature> with two possible values and three properties. composite means it’s a feature composed of other features (in this case <define>SOMEMACRO). propagated means that any targets that include a target with this feature set will also have this feature set. and link-incompatible means targets with <steves-feature>on can’t be combined with targets with <steves-feature>off. (As a result, bjam will put the created files under a directory named steves-feature-on or steves-feature-off if this feature is set by any target.)

    This feature can be used just like the <define> feature used in the project rule in the above section. (You can even add it to a default-build section of the project rule.)

    Note that you can also set features from the command line: bjam steves-feature=on.

    C. You want a full variant. I think the idea is if you have a few common build configurations with a bunch of different features that should be set together. Well, if you’ve already created the feature as above, this is now easy.

    variant steves-debug : debug : <steves-feature>on ;
    

    This variant will be the same as the debug variant but with the additional feature <steves-feature>on.

    I’ve never used the variant rule, so it might need to be imported from somewhere. Also, you might be able to do

    variant steves-debug : debug : <define>SOMEMACRO ;
    

    but I don’t know if bjam will create the directory structure or not. (It probably will.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a French site that I want to parse, but am running into
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
This could be a duplicate question, but I have no idea what search terms
I want to construct a data frame in an Rcpp function, but when I
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.