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 7502881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:01:42+00:00 2026-05-29T21:01:42+00:00

I have a file in one of our projects that defines a variable that

  • 0

I have a file in one of our projects that defines a variable that affects the behavior of most of the other modules throughout the project. Let’s call it custom.h. It looks like this:

#pragma once

#define BUILD 3 // 1: personal, 2: select, 3: elite

Throughout the project there are numerous references to this variable to control behavior between product editions. Changing this value triggers a rebuild of most of the project. What I’d like to do is create separate Build Configurations, one for each edition, so that it only rebuilds modified files, not the entire project, when I make a change to the edition.

If I have three Configurations, one for each edition, is there a way to get Visual Studio not to rebuild when a change is made to this custom.h file if the edition matched what was built for that Configuration already? IE, if I set BUILD to 3 and build with the Elite Configuration, then change BUILD to 2 and build with the Select Configuration, I don’t want it to rebuild the whole project, because the Intermediary Files for Select should already exist.

The Configurations all have their own Intermediary Directories as well as their own Output Directories. It feels like I’m close to what I need, but some advice at this point would be invaluable.

  • 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-29T21:01:47+00:00Added an answer on May 29, 2026 at 9:01 pm

    Rather than changing the defines for each build, one option would be to use configurations like you mentioned and define Preprocessor Definitions in your project. Then use compile directives for each configuration. I think this would let your incremental compiles work correctly.

    Your custom.h would look like this:

    #pragma once
    
    #if defined(PERSONAL)
        #define BUILD 1 
    #elif defined(SELECT)
        #define BUILD 2 
    #elif defined(ELITE)
        #define BUILD 3 
    #endif
    

    The Preprocessor Definitions can be set in the Project Properties or via command line switches depending on how you build.

    Directives on MSDN

    Preprocessor Definitions on MSDN

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

Sidebar

Related Questions

I have two different modules that need access to a single file (One will
Our current solutions/projects have several classes combined into one file, I'm told this was
We have in one of our applications a single eclipse project that contains all
I have one file in my project, (the readme file,) which I would like
I have problem with session in cakephp.I have one file chat.php that is in
We have two different projects on our source safe database (one of them is
I joined a project yesterday, we decided to merge our two projects into one,
Background: In our project, we have a bunch of xml files that define tests
I have multiple projects in our solution that is in our TFS 2010 repository.
I recently acquired VS2010 to run one of our global 2010 projects. Among other

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.