From d0ab1edf67bda2fd5fa672106fbdbe1dfb923a5e Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Mon, 18 Feb 2019 12:37:21 +0000 Subject: [PATCH] Added support for `csversion` API to dotnet toolset. --- src/tools/dotnet.lua | 4 ++++ tests/tools/test_dotnet.lua | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/tools/dotnet.lua b/src/tools/dotnet.lua index d7445b04..a22a6b22 100644 --- a/src/tools/dotnet.lua +++ b/src/tools/dotnet.lua @@ -294,6 +294,10 @@ table.insert(flags, table.implode(cfg.defines, "/d:", "", " ")) end + if cfg.csversion ~= nil then + table.insert(flags, '/langversion:' .. cfg.csversion) + end + return table.join(flags, cfg.buildoptions) end diff --git a/tests/tools/test_dotnet.lua b/tests/tools/test_dotnet.lua index 8ed7c8a7..3f5bb6cf 100644 --- a/tests/tools/test_dotnet.lua +++ b/tests/tools/test_dotnet.lua @@ -44,3 +44,14 @@ prepare() test.isequal("mcs", dotnet.gettoolname(cfg, "csc")) end + + +-- +-- Check support for the `csversion` API +-- + +function suite.flags_csversion() + prepare() + csversion "7.2" + test.contains({ "/langversion:7.2" }, dotnet.getflags(cfg)) +end