File tree Expand file tree Collapse file tree 6 files changed +23
-0
lines changed Expand file tree Collapse file tree 6 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,19 @@ if (CLR_CMAKE_HOST_WIN32)
3131 set_target_properties (${targetName} PROPERTIES COMPILE_OPTIONS "${compileOptions} " )
3232 endfunction ()
3333
34+ function (add_ijw_msbuild_project_properties targetName ijwhost_target)
35+ # When we're building with MSBuild, we need to set some project properties
36+ # in case CMake has decided to use the SDK support.
37+ # We're dogfooding things, so we need to set settings in ways that the product doesn't quite support.
38+ # We don't actually need an installed/available target framework version here
39+ # since we are disabling implicit framework references. We just need a valid value, and net8.0 is valid.
40+ set_target_properties (${targetName} PROPERTIES
41+ DOTNET_TARGET_FRAMEWORK net8.0
42+ VS_GLOBAL_DisableImplicitFrameworkReferences true
43+ VS_GLOBAL_GenerateRuntimeConfigurationFiles false
44+ VS_PROJECT_IMPORT "${CMAKE_CURRENT_FUNCTION_LIST_DIR} /SetIJWProperties.props" )
45+ endfunction ()
46+
3447 # 4365 - signed/unsigned mismatch
3548 # 4679 - Could not import member. This is an issue with IJW and static abstract methods in interfaces.
3649 add_compile_options (/wd4365 /wd4679)
Original file line number Diff line number Diff line change 1+ <Project >
2+ <PropertyGroup >
3+ <!-- 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. -->
4+ <UseIJWHost >false</UseIJWHost >
5+ </PropertyGroup >
6+ </Project >
Original file line number Diff line number Diff line change @@ -12,5 +12,6 @@ add_library(ijw SHARED ${SOURCES})
1212target_link_libraries (ijw PRIVATE ${LINK_LIBRARIES_ADDITIONAL} )
1313
1414remove_ijw_incompatible_target_options(ijw)
15+ add_ijw_msbuild_project_properties(ijw ijwhost)
1516
1617install_with_stripped_symbols(ijw TARGETS corehost_test)
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ set(SOURCES IjwCopyConstructorMarshaler.cpp)
77# add the shared library
88add_library (IjwCopyConstructorMarshaler SHARED ${SOURCES} )
99target_link_libraries (IjwCopyConstructorMarshaler PRIVATE ${LINK_LIBRARIES_ADDITIONAL} )
10+ add_ijw_msbuild_project_properties(IjwCopyConstructorMarshaler ijwhost)
1011
1112# add the install targets
1213install (TARGETS IjwCopyConstructorMarshaler DESTINATION bin)
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ set(SOURCES IjwNativeDll.cpp)
77# add the shared library
88add_library (IjwNativeDll SHARED ${SOURCES} )
99target_link_libraries (IjwNativeDll PRIVATE ${LINK_LIBRARIES_ADDITIONAL} )
10+ add_ijw_msbuild_project_properties(IjwNativeDll ijwhost)
1011
1112# add the install targets
1213install (TARGETS IjwNativeDll DESTINATION bin)
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ set(SOURCES IjwNativeVarargs.cpp)
77# add the shared library
88add_library (IjwNativeVarargs SHARED ${SOURCES} )
99target_link_libraries (IjwNativeVarargs PRIVATE ${LINK_LIBRARIES_ADDITIONAL} )
10+ add_ijw_msbuild_project_properties(IjwNativeVarargs ijwhost)
1011
1112# add the install targets
1213install (TARGETS IjwNativeVarargs DESTINATION bin)
You can’t perform that action at this time.
0 commit comments