Fix embedded coreclr detection in corhost.cpp #80294
Merged
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.
The
CORECLR_EMBEDDED
define that is used in corhost.cpp to detect whether the current host has coreclr and some other native libraries embedded or not doesn't work. The reason is that corhost.cpp is not compiled separately for the cases of embedded and non-embedded coreclr.The proper way is to check the
g_coreclr_embedded
global variable that is defined in the ceemain.cpp, which is compiled separately for those two cases.While we could also make the corhost.cpp build twice, it would be a waste of time.