vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

CMake Tools not populating environment variables with Legacy Driver

Open emnkoksal opened this issue 3 years ago • 2 comments

I was able to reproduce and fix the issue. It was a silly mistake with a hole in the TS type-checker. I found that the issue only occurs when using non-cmake-server mode. The legacy driver wasn't receiving the environment variables from configuration.

The issue you're seeing when you enable CMake Server is another issue. If I were you, I'd do some investigation and maybe open another issue for it.

Originally posted by @vector-of-bool in https://github.com/microsoft/vscode-cmake-tools/issues/384#issuecomment-383352180

emnkoksal avatar Jul 04 '22 13:07 emnkoksal

Can you share an example where this isn't working for you? The code is essentially the same after that fix. We have validated that the cmake.environment is being used for the legacy driver.

bobbrow avatar Jul 05 '22 16:07 bobbrow

I have found that the source of problem actually is that when CMake-Tools Kit has <LANG>COMPILER defined, then it sets CMAKE<LANG>_COMPILER_ARG1 differently. But when the Kit has <LANG>COMPILER undefined (empty string), then CMAKE<LANG>_COMPILER_ARG1 is set as $ENV{CC}.

Thus, cmake configuration works when the Kit does not define compiler. Isn't it a bit rare?

emnkoksal avatar Jul 05 '22 17:07 emnkoksal

This issue is now marked as 'stale' due to there being no activity on it for the past 30 days and being labelled 'more info needed'. Unless the 'stale' label is removed or the issue is commented on, this will be closed in 7 days. If you would like to make this issue exempt from getting stale, please remove the 'more info needed' and 'stale' labels or add the 'stale-exempt' label

github-actions[bot] avatar Oct 18 '23 15:10 github-actions[bot]

This issue is now closed due to there being no activity on it for the past 7 days since being marked as 'stale'.

github-actions[bot] avatar Oct 26 '23 07:10 github-actions[bot]