Code Monkey home page Code Monkey logo

Comments (2)

ffulin avatar ffulin commented on June 26, 2024

Hello

When I designed FASTBuild, I wanted to make sure that you could build multiple configurations in parallel. It's really nice to be able to build all configs (Debug & Release for example) in parallel before submitting changes (with "fbuild all" for example). A make-like command line support for defines is counter to this goal.

I think you really want to declare your permanent configs in the bff, but I can see how if you have many transient options creating a full matrix is pretty painful.

With that in mind, I see two options:

1) In the bff

  • declare the permanent configs (like release and debug)
  • group your temporary settings (those that aren't automatically derived from the above) together and declare them with #define and enable disable them as required:
//#define USE_SIMD_INSTRUCTIONS
#define WITH_GLES_CG_SUPPORT

Pro: Switching between Debug and Release does't cause unnecessary rebuilding
Pro: No changes required to FASTBuild
Con: Local edits to bff may be undesireable

2) Add command line -define support
Your patch as it stands isn't safe, because it doesn't cause the bff config to be re-evaluated when you change the defines. This means config based on those defines isn't updated and things are not rebuilt when needed. So switching between build configs won't correctly rebuild for example.
This can be fixed by extending your change to record the name and values of the defines and re-parsing if those change between builds. FASTBuild already does this for #import directive, so that code could be extended to track these defines in the same way.
Pro: Less complicated bff / aligns with your expectations
Con: Rebuilds whenever you change anything
Con: Can't parallelize multiple configs
Con: Change to FASTBuild required

Let me know what you think about these options.

PS - If you'd like to pursue option 2, could you please create a pull request rather than attaching a diff? It would make integration much easier.

from fastbuild.

shooshx avatar shooshx commented on June 26, 2024

Thank you for the reply

  1. I see your point but indeed maintaining that matrix for me turned out way more complicated than I was wanted, especially given that the sluggish ndk-build script it replaced was quite simple.
  2. I realized this problem with my patch after trying to use it for a bit :)
    I'll figure out the needed fix and create a pull request.
    Thank you for the guidance.

If you mentioned #import than I can mention an issue I had with it, I'll create another github issue.

from fastbuild.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.