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

nwn_script_comp: Cannot compile an include file on its own #99

Open
PhilippeChab opened this issue Oct 22, 2023 · 2 comments
Open

nwn_script_comp: Cannot compile an include file on its own #99

PhilippeChab opened this issue Oct 22, 2023 · 2 comments

Comments

@PhilippeChab
Copy link

Description

This feature was added in the nwnsc and was useful for the language server. It would be neat to have it available in the nwn_script_comp as well.

@mtijanic
Copy link
Collaborator

I can see how it could be useful, but also I would definitely want the "no main function" to be an error by default. This could be a flag to the nim frontend, to just generate a temporary file like

#include "actual_file"
void main() {}

and compile that, discarding the result.

Would you need this in burst mode too, or just when compiling a single include?

@PhilippeChab
Copy link
Author

PhilippeChab commented Oct 23, 2023

It is actually what I would have done on my end if it was not going to be supported.

A flag parameter would be perfect.

The most complex case I need to support is the following:

  • /constants/
    • /constants/const_colors.nss
  • /libs/
    • /libs/inc_database.nss
  • /cli/
    • /cli/const_cli.nss

With const_cli.nss being an include:

#include "const_colors"
#include "inc_database"

...

I would need to be able to compile all 3 includes at once.

EDIT:
With the --dirs flag and children includes loaded in resman, I only need this for a single include.

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

No branches or pull requests

2 participants