Skip to content

Commit

Permalink
Improve the dotnet version checks in configure.ac
Browse files Browse the repository at this point in the history
- The minimum version should have been updated to 7.0 to go along with PR #595

- Use the target framework for whichever newer dotnet version is found, instead of hardcoding only net8.0. This allows for more forward compatibility if more dotnet versions are released before a newer Pinta release

Fixes: #616
  • Loading branch information
cameronwhite committed Dec 22, 2023
1 parent 7b234c1 commit ed11106
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@ if test "x$DOTNET" = "xno"; then
fi

# Check dotnet version
DOTNET_MINIMUM_VERSION=6.0
DOTNET_MINIMUM_VERSION=7.0
DOTNET_VERSION=$($DOTNET --version)
AX_COMPARE_VERSION([$DOTNET_VERSION], [ge], [$DOTNET_MINIMUM_VERSION],
AC_MSG_NOTICE([Found dotnet $DOTNET_VERSION]),
AC_MSG_ERROR([dotnet $DOTNET_MINIMUM_VERSION or higher is required (found version $DOTNET_VERSION).])
)

# Select target framework based on the dotnet version.
DOTNET_TARGET_FRAMEWORK=net7.0
AX_COMPARE_VERSION([$DOTNET_VERSION], [ge], [8.0],
[DOTNET_TARGET_FRAMEWORK=net8.0], [])
DOTNET_MAJOR_VERSION=$(echo $DOTNET_VERSION | cut -d '.' -f 1,2)
DOTNET_TARGET_FRAMEWORK="net$DOTNET_MAJOR_VERSION"
AC_MSG_NOTICE([Using target framework $DOTNET_TARGET_FRAMEWORK])

DOTNET_CMD="env TargetFramework=$DOTNET_TARGET_FRAMEWORK $DOTNET"
Expand Down

0 comments on commit ed11106

Please sign in to comment.