Isn't the current build system already complicated enough? Why do we need to support even more setups in even worse ways?
The idea is to simplify it for you, in the first place. AFAIK, you don't want to support other compilers than mingw. In the second place -- the ability to just copy custom files into compilers/compiler-name/ w/o additional changes to all meson.build files.
So the meson.build file will look like it written for mingw, with only one condition to include third-party directory, which will be supported by the others, or left as-is, not your problem. But yes, the final solution can be worse. That's why asking.
In particular, I remembered about "dxvk-native", and finally tried to build it. I don't know what the status of this patch, but it trying to mess with the build system even more. Maybe such changes should help to simplifiy the patch, idk. @Guy1524 ?
@pchome I'll have to look back at my patch to see if this is desirable, but I think the bigger issue was that my patch involved a lot of compiler directives scattered around.
@Guy1524
It's possible to disable dxgi and d3d10 build using -Denable_dxgi=false and -Denable_d3d10=false meson options. Also, maybe you could use -D__WINE__=1 along with -DDXVK_NATIVE=1, this should slightly reduce the patch size.
Talking about custom targets, that could be one more "compiler/" include right after subdir('src') and build_by_default option for all targets, to control. I such case it will be possible to use all DXVK's *_src= variables for custom target, defined in corresponding "include".
I should stop doing dirty hacks (lazybones).
I remembered, I already tried to do something like this a while ago, and that was rather bad idea.
Nothing extracted yet.
Description
People want more compiler/options variants, which are hard to support and which became insane in the
meson.buildfile. Let's isolate this variations in the separate directory structures, so if one want support new "compiler-name" compilation, it will be easy to do so, by copy/patch files somewhere else, not touching mainmeson.build.Idea
Create e.g.
compiler/directory w/ the following structure:Each can contain whatever they need to compile DXVK (additional includes/files/etc.), cross-files and
meson.build.The
meson.buildfile should contain what currently under corresponding condition in the mainmeson.buildfile.e.g. for winelib: https://github.com/doitsujin/dxvk/blob/master/meson.build#L28-L49
All conditions then could be replaced by the following code
or
Clarification
Based on how Meson
subdir()command workIf "mingw-gcc" is default and only supported compiler, then not necessary to create
compiler/mingw-gcc/directory for it. You can keep it's parts as-is, just drop everything else and add the ability to redefine variables.Well, then just forget about those files, no need to support them. Anyone, who use them, will be able to create PR to improve/fix corresponding compilation.
Mics
Also, later, it may be worth to define more generic names for some lower-level variables, to be redefined. E.g.
d3d11_shared_objects=(d3d11_shared_(defs|overrides|...)=, found insrc/d3d11/meson.build).More of possible change candidates:
d3d10_deps=and other places/variables with conditions, shared library names, etc.Conclusion
Just a basic idea. I could create this in practice and PR, if it worth so.
Theoretically should help "clang"/"dxvk-native"/"macOS"/... users. Also "winelib", to not being completely dropped ;)