dotnet: Add net46,net461,net462 support

This commit is contained in:
Corentin Le Molgat
2022-11-21 17:27:02 +01:00
parent 03abc88fd0
commit ea0038d924
2 changed files with 19 additions and 0 deletions

View File

@@ -265,6 +265,16 @@ if(BUILD_DOTNET)
set(DOTNET_SAMPLE_LANG "8.0" CACHE STRING "Specify the C# language version for samples (default \"8.0\")")
message(STATUS ".Net C# language version: ${DOTNET_SAMPLE_LANG}")
# Targeted Framework Moniker
# see: https://docs.microsoft.com/en-us/dotnet/standard/frameworks
# see: https://learn.microsoft.com/en-us/dotnet/standard/net-standard
option(USE_DOTNET_46 "Use .Net Framework 4.6 support" OFF)
message(STATUS ".Net: Use .Net Framework 4.6 support: ${USE_DOTNET_46}")
option(USE_DOTNET_461 "Use .Net Framework 4.6.1 support" OFF)
message(STATUS ".Net: Use .Net Framework 4.6.1 support: ${USE_DOTNET_461}")
option(USE_DOTNET_462 "Use .Net Framework 4.6.2 support" OFF)
message(STATUS ".Net: Use .Net Framework 4.6.2 support: ${USE_DOTNET_462}")
option(USE_DOTNET_48 "Use .Net Framework 4.8 support" OFF)
message(STATUS ".Net: Use .Net Framework 4.8 support: ${USE_DOTNET_48}")

View File

@@ -71,6 +71,15 @@ message(STATUS ".Net runtime project build path: ${DOTNET_NATIVE_PROJECT_DIR}")
# Targeted Framework Moniker
# see: https://docs.microsoft.com/en-us/dotnet/standard/frameworks
# see: https://learn.microsoft.com/en-us/dotnet/standard/net-standard
if(USE_DOTNET_46)
list(APPEND TFM "net46")
endif()
if(USE_DOTNET_461)
list(APPEND TFM "net461")
endif()
if(USE_DOTNET_462)
list(APPEND TFM "net462")
endif()
if(USE_DOTNET_48)
list(APPEND TFM "net48")
endif()