Unify asset building and use find_program to find NPM #2522
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Firstly, this unifies the asset building by leveraging CMake's env command.
add_custom_target
can also accept multiple commands to be run in sequence. It isn't clear how quoting applies here, but I've tested it, and it seems to be behave as expected when spaces are present.Secondly, this uses
find_program
to find NPM so it can be overridden. This is useful for Gentoo, which needs to be able to do entirely offline builds, because it can override this with/bin/true
while shipping pre-compiled assets. Gentoo has tried to ship cached NPM modules instead, but it turns out these are very sensitive to the NPM version. I also tried swapping in Yarn, which handles caching better, but ran into other issues.Type of Change
.github/...
)Checklist
Branch Updates
LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.