-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix MSBuild integration for the host build with CMake 3.26 #88208
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -31,6 +31,19 @@ if (CLR_CMAKE_HOST_WIN32) | |||
set_target_properties(${targetName} PROPERTIES COMPILE_OPTIONS "${compileOptions}") | ||||
endfunction() | ||||
|
||||
function(add_ijw_msbuild_project_properties targetName ijwhost_target) | ||||
# When we're building with MSBuild, we need to set some project properties | ||||
# in case CMake has decided to use the SDK support. | ||||
# We're dogfooding things, so we need to set settings in ways that the product doesn't quite support. | ||||
# We don't actually need an installed/available target framework version here | ||||
# since we are disabling implicit framework references. We just need a valid value, and net8.0 is valid. | ||||
set_target_properties(${targetName} PROPERTIES | ||||
DOTNET_TARGET_FRAMEWORK net8.0 | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we pass this value from the invocation script to avoid manual updates in the future? If we could capture this value Line 6 in 5a24757
-DCLR_DOTNET_TFM=net%DotnetMajorVersion%.0 , that will do the trick.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't actually need an installed/available version here since we are disabling implicit framework references. We just need a valid value. I'll add a comment. |
||||
VS_GLOBAL_DisableImplicitFrameworkReferences true | ||||
VS_GLOBAL_GenerateRuntimeConfigurationFiles false | ||||
VS_PROJECT_IMPORT "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/SetIJWProperties.props") | ||||
endfunction() | ||||
|
||||
# 4365 - signed/unsigned mismatch | ||||
# 4679 - Could not import member. This is an issue with IJW and static abstract methods in interfaces. | ||||
add_compile_options(/wd4365 /wd4679) | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<!-- The C++/CLI targets don't let us set this in the project file where CMake lets us set project properties, so we set it in an imported project file where it will work. --> | ||
<UseIJWHost>false</UseIJWHost> | ||
</PropertyGroup> | ||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is ijwhost_target needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted a customization layer here as the name ijwhost isn't required to be the same (and the name for the fake implementation in src/tests has changed at times)