Skip to content

Pass '/X' to ensure that msvc doesn't use include paths from the environment#122

Merged
MarkSchofield merged 1 commit intomainfrom
mschofie/x-switch
Nov 22, 2024
Merged

Pass '/X' to ensure that msvc doesn't use include paths from the environment#122
MarkSchofield merged 1 commit intomainfrom
mschofie/x-switch

Conversation

@MarkSchofield
Copy link
Copy Markdown
Owner

Fixes #121.

By default, MSVC will read the 'INCLUDE' environment variable to configure include paths for compilation. WindowsToolchain attempts to push environment variables to CMake constructs to canonicalize the build, so leveraging the '/X' command-line parameter to MSVC - which causes it to ignore the 'INCLUDE' environment variable - would support the effort.

@MarkSchofield MarkSchofield merged commit b4a4208 into main Nov 22, 2024
@MarkSchofield MarkSchofield deleted the mschofie/x-switch branch November 22, 2024 01:43
InCom-0 pushed a commit to InCom-0/cmake_WindowsToolchain that referenced this pull request Mar 10, 2026
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

Successfully merging this pull request may close these issues.

WindowsToolchain should pass '/X' to cl.exe to ignore INCLUDES environment variables

1 participant