You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably not the best place for this line to be as I'm not a gyp expert, but it works for me. I'm completely open to suggestions if anyone has better ideas on how to achieve this.
My use case is I wanted to easily set some compiler flags (e.g. _WIN32_WINNT) without having to touch every gyp/gypi file in a project. On *nix you can simply set the CFLAGS/CXXFLAGS/etc. environment variables and it'll just work.
However on Windows it's a different story. Technically you can set a CL environment variable to pass flags to CL.exe, but since gyp uses msbuild, environment variables like CL don't get picked up/used automatically. Because of this, we need to explicitly pass the values to the msbuild project file.
I tried looking to see if node-gyp/gyp had some way of achieving the same thing using the command line, but I could not find anything, so using environment variables seems like the next best bet.
Also, I'm not entirely sure but "cl" might need to also be added to msvs_emulation.py in the environment variable list in _ExtractImportantEnvironment. It appears that file is mostly for ninja builds, which I can't test right now.
It looks like the unrelated windows integration failure is because node is floating changes on top of gyp that do not exist in node-gyp's vendored copy of gyp or in gyp-next itself. Specifically, gyp isn't setting PRODUCT_DIR_ABS. The use of this variable started with the landing of OpenSSL 3.0 I believe.
It looks like the unrelated windows integration failure is because node is floating changes on top of gyp that do not exist in node-gyp's vendored copy of gyp or in gyp-next itself. Specifically, gyp isn't setting PRODUCT_DIR_ABS. The use of this variable started with the landing of OpenSSL 3.0 I believe.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This is probably not the best place for this line to be as I'm not a gyp expert, but it works for me. I'm completely open to suggestions if anyone has better ideas on how to achieve this.
My use case is I wanted to easily set some compiler flags (e.g. _WIN32_WINNT) without having to touch every gyp/gypi file in a project. On *nix you can simply set the
CFLAGS/CXXFLAGS/etc. environment variables and it'll just work.However on Windows it's a different story. Technically you can set a
CLenvironment variable to pass flags to CL.exe, but since gyp uses msbuild, environment variables likeCLdon't get picked up/used automatically. Because of this, we need to explicitly pass the values to the msbuild project file.I tried looking to see if node-gyp/gyp had some way of achieving the same thing using the command line, but I could not find anything, so using environment variables seems like the next best bet.