-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
split off main.d from mars.d #15472
split off main.d from mars.d #15472
Conversation
Thanks for your pull request, @WalterBright! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#15472" |
There is already an entrypoint for DMD as a library in frontend.d, have you looked at it? |
@maxhaton Yes, there is an entry point for dmd as a lib, however, mars.d currently contains (or used to contain) some functions that need to be used for config purposes in dmd as a lib. In the past, we used to just move these functions to other files that are included in dmd-as-a-lib, because mars.d is currently excluded the packaging of the library. @WalterBright I approve this addition, however, why not go fully in this direction? What I mean is that we can keep all of the functions that
That's fine. It's the main function after all. dmd-as-a-lib does not include this file. And that's what
I cannot parse this sentence, too many negations. But I think the simplest way to move forward is to just keep everything, except for the main function, in |
That's the point, I only moved the functions over to |
But dmd as a library might use that code even if the not NoMain code uses it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Obviously, the only time dmd will need a
main
is if a standalone console program is being generated. For dmd-as-library, an LSP plugin, or a DLL, nomain
is required. So I thought I'd split offmain
and put it in its own file,main.d
, along with the code versioned as "notNoMain
". This should be straightforward.Knotty problems:
@RazvanN7 I could use your advice on your vision for dmd-as-library, and maybe we can extirpate the naughtiness with this code, so this PR is not for nought.