aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/sourceset.py
AgeCommit message (Collapse)AuthorFilesLines
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-1/+1
performed by running "pyupgrade --py36-plus" and committing the results
2020-11-15stabilize sets that are converted to listsPaolo Bonzini1-2/+2
The order of elements in sets cannot be relied upon, because the hash values are randomized by Python. Whenever sets are converted to lists we need to keep their order stable, or random changes in the command line cause ninja to rebuild a lot of files unnecessarily. To stabilize them, use either sort or OrderedSet. Sorting is not always applicable, but it can be faster because it's done in C and it can produce slightly nicer output.
2020-04-21switch python2 %s for python3 .formatMichael1-1/+1
2019-08-04sourceset: add all_dependencies() methodMarc-André Lureau1-0/+9
'if_true' sources should be built with their dependencies, as illustrated by test case change. Ideally, I think we would want only the files with the dependencies to be built with the flags, but that would probably change the way sourceset are used.
2019-08-04sourceset: fix using FeatureCheck decoratorsMarc-André Lureau1-4/+5
The feature check facilities need to have access to subproject.
2019-05-22new module "sourceset" to match source file lists against configuration dataPaolo Bonzini1-0/+190
In QEMU a single set of source files is built against many different configurations in order to generate many executable. Each executable includes a different but overlapping subset of the source files; some of the files are compiled separately for each output, others are compiled just once. Using Makefiles, this is achieved with a complicated mechanism involving a combination of non-recursive and recursive make; Meson can do better, but because there are hundreds of such conditional rules, it's important to keep meson.build files brief and easy to follow. Therefore, this commit adds a new module to satisfy this use case while preserving Meson's declarative nature. Configurations are mapped to a configuration_data object, and a new "source set" object is used to store all the rules, and then retrieve the desired set of sources together with their dependencies. The test case shows how extract_objects can be used to satisfy both cases, i.e. when the object files are shared across targets and when they have to be separate. In the real-world case, a project would use two source set objects for the two cases and then do "executable(..., sources: ... , objects: ...)". The next commit adds such an example.