On 11/20/13, 9:49 AM, Benoit Jacob wrote:



2013/11/20 Gregory Szorc <g...@mozilla.com <mailto:g...@mozilla.com>>

    On Nov 20, 2013, at 9:37, Benoit Jacob <jacob.benoi...@gmail.com
    <mailto:jacob.benoi...@gmail.com>> wrote:

     > Talking about ideas for further extending the impact of
    UNIFIED_SOURCES, it
     > seems that the biggest limitation at the moment is that sources
    can't be
     > unified between different moz.build's. Because of that, source
    directories
     > that consist of many small sub-directories do not benefit much from
     > UNIFIED_SOURCES at the moment. I would love to have the ability
    to declare
     > in a moz.build that UNIFIED_SOURCES from here downwards, including
     > subdirectories, are to be unified with each other. Does that sound
     > reasonable?

    You can do this today by having a parent moz.build list sources in
    child directories.


 From the perspective of someone porting a directory to UNIFIED_SOURCES,
and wanting to make minimal changes at this point to see how much
compile time improvement we can get without making too intrusive changes
everywhere, that is not the same: Switching an entire directory to
listing all sources in the parent moz.build is a very intrusive change
to make to the build system. I've been refraining from doing that for now.

Having the build automagically do this right now is dangerous. The rules to derive the flags to pass to the compiler are dependent on the moz.build/Makefile.in the source definition came from. Since we don't have things like CFLAGS in moz.build files yet nor do we have the logic for deriving compiler flags in Python (they live in config.mk), having variables defined in child directories magically get moved to parent directories breaks the contract on how compiler flags are derived.

I'd therefore strongly prefer the user-facing lists in moz.build files closely match what's actually happening.

Long term, we'll have a better way of defining libraries. Right now, you produce one library/archive per directory. In the future, we'll likely expose a "class" to represent libraries/translation units and you'll be able to define multiple instances in one moz.build file. This requires significantly revamping our make logic/rules first, so it's not a trivial effort. In time.

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to