-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[hlc] Add jumbo build for vs template #737
Conversation
Should we maybe have a single define for enabling or disabling them? Something like this, but I'm not sure if there is a standard for using -D hlgen.jumbo=yes
-D hlgen.jumbo=no This will make it easier to have a different default value for this define based on which template we are using, as the trade off will be different for other compilers. Currently, these template related defines all have makefile in the name, should we continue with this standard? It may also make sense to rename the |
I don't think
I'm not sure that I understand you here. |
We can set setJumboBuildDefault: function(c, boolString:String) {
final value = switch boolString {
case "true": true;
case "false": false;
default: throw 'setJumboBuildDefault value must be true or false';
};
context.jumboBuild ??= value;
return "";
} So if
Yes, I got them the other way around. I think the original intention behind the
However, now we want to allow templates that also put everything into a single file for the benefits of the jumbo build, so this connection between using We can change hlc gen to write: #if !defined(HL_MAKE) || defined(HL_JUMBO)
which separates the concept of a jumbo build from a "template" build. Then all templates set <PreprocessorDefinitions>_DEBUG;_CONSOLE;HL_MAKE;::if jumboBuild::HL_JUMBO;::end::;%(PreprocessorDefinitions)</PreprocessorDefinitions> This way, we allow |
Changed to I agree that |
This looks good!
Perhaps in the future we can sort this out in a backwards compatible way by checking the version in hlc.json. I also wonder if the precompiled headers are useful at all with a jumbo build? Maybe that should be checked. |
I just tested with a large project, it takes 59-62s in a jumbo build with precompiled header; and 62-64s without precompiled headers (I don't understand why, but I'll keep precompiled header for that). |
As jumbo is a string now, would it make more sens to have |
I think this will have problems because we might want to enable jumbo at the same time as some other mode, but with this method we would only ever be able to enable one at a time. I think a boolean flag separate from anything else makes most sense here. |
Ok. I'm not very satisfied with the comparison using |
Add jumbo build (aka unity build but I prefer avoid using "unity") for hlc templates and use it by default for better hlc compilation speed with Visual Studio (especially when use hl/jit for dev and hl/c for release).
If incremental build is preferred, jumbo build can be disabled by setting
-D hlgen.nojumbo
.@tobil4sk made a couple of tests and it turns out that this all-in-one build strategy is still the quickest and is a known approach. It's already used internally in Shiro's project but was made by manually editing vcsproj file.