Skip to content
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

Add sqfc support #1450

Merged
merged 4 commits into from
Jun 3, 2021
Merged

Add sqfc support #1450

merged 4 commits into from
Jun 3, 2021

Conversation

PabstMirror
Copy link
Contributor

No description provided.

@PabstMirror PabstMirror added this to the 3.15.4 milestone May 8, 2021
tools/make.py Outdated Show resolved Hide resolved
sqfc.json Outdated Show resolved Hide resolved
@commy2
Copy link
Contributor

commy2 commented May 9, 2021

I know it literally uses compileScript, but can we get a better name on COMPILESCRIPT_FILE that somehow explains what is going on?

@PabstMirror
Copy link
Contributor Author

Open to suggestions

@PabstMirror
Copy link
Contributor Author

I disabled compiling on

        "diagnostic\\fnc_initExtendedDebugConsole.sqf",
        "xeh\\fnc_initDisplay.sqf",
        "xeh\\fnc_startLoadingScreen.sqf",
        "xeh\\fnc_endLoadingScreen.sqf"

as they all have the basic format of

call {
    #include "\a3\functions_f\GUI\fn_initDisplay.sqf"
};
// cba code here

If A3 were to change these functions then it could cause issues because CBA would be stuck on a older version

@commy2
Copy link
Contributor

commy2 commented May 24, 2021

If A3 were to change these functions then it could cause issues because CBA would be stuck on a older version

Huh? I don't get it.

@PabstMirror
Copy link
Contributor Author

When compiling it will take the current version in your p-drive and "statically links" it into the sqfc
So if in arma 2.08 BIS changes something in \a3\functions_f\GUI\fn_initDisplay.sqf, the sqfc would still have the old version.

By not compiling, it will do the #include " at preStart, just like it works now before the sqfc stuff.
It's probably never going to be an issue, but it's a tiny bit safer to just not do these 4 files.

@commy2
Copy link
Contributor

commy2 commented May 24, 2021

Not a perfect solution though. Can't we mark it somehow in the script file that it should not be proessed like that? That seems more explicit and maintainable.

@PabstMirror
Copy link
Contributor Author

JSON doesn't support comments for some reason
could add comments as data, but I don't really like that

it's just the few functions we hijack via class CfgFunctions { class A3{ ....

@PabstMirror
Copy link
Contributor Author

This PR is ready so I'll merge, but it does not necessarily mean that next CBA release will be using compiled SQFC
we're still using make.py//pboProject so we'll have to manually compile

@PabstMirror PabstMirror merged commit 9191ad5 into master Jun 3, 2021
@PabstMirror PabstMirror deleted the sqfc branch June 3, 2021 20:36
@severgun
Copy link
Contributor

severgun commented Jun 3, 2021

what is a problem to add compile stage to make.py?

@PabstMirror
Copy link
Contributor Author

probably 1 line to call compile_sqf.py
tbh I'd rather do it manually for the first few releases to look for problems

@dedmen
Copy link
Contributor

dedmen commented Aug 18, 2021

Not a perfect solution though. Can't we mark it somehow in the script file that it should not be proessed like that? That seems more explicit and maintainable.

dedmen/ArmaScriptCompiler#12

Just add #pragma SQFC_NO_COMPILE to top of the file.
Its not implemented yet, but I will soon-ish-ish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants