Skip to content

Commit

Permalink
Add .Net 9.0 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Nov 8, 2024
1 parent 48592c1 commit c79a2fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,19 @@ message(STATUS ".Net: Use .Net 7.0 support: ${USE_DOTNET_7}")
option(USE_DOTNET_8 "Use .Net 8.0 LTS support" OFF) # EOL: 2026-11-10
message(STATUS ".Net: Use .Net 8.0 support: ${USE_DOTNET_8}")

option(USE_DOTNET_9 "Use .Net 9.0 support" OFF) # EOL: 2026-05-14
message(STATUS ".Net: Use .Net 9.0 support: ${USE_DOTNET_9}")

include(dotnet)

add_subdirectory(tests)

option(BUILD_EXAMPLES "Build examples" ON)
message(STATUS "Build examples: ${BUILD_EXAMPLES}")

if(USE_DOTNET_8)
if(USE_DOTNET_9)
set(EXAMPLE_DEFAULT_TFM "net9.0")
elseif(USE_DOTNET_8)
set(EXAMPLE_DEFAULT_TFM "net8.0")
elseif(USE_DOTNET_7)
set(EXAMPLE_DEFAULT_TFM "net7.0")
Expand Down
6 changes: 6 additions & 0 deletions cmake/dotnet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ endif()
if(USE_DOTNET_8)
list(APPEND TFM "net8.0")
endif()
if(USE_DOTNET_9)
list(APPEND TFM "net9.0")
endif()

list(LENGTH TFM TFM_LENGTH)
if(TFM_LENGTH EQUAL "0")
Expand Down Expand Up @@ -227,6 +230,9 @@ function(add_dotnet_test FILE_NAME)
if(USE_DOTNET_8)
add_dotnet_tfm_test(${FILE_NAME} net8.0)
endif()
if(USE_DOTNET_9)
add_dotnet_tfm_test(${FILE_NAME} net9.0)
endif()
message(STATUS "Configuring test ${FILE_NAME} ...DONE")
endfunction()

Expand Down

0 comments on commit c79a2fa

Please sign in to comment.