summaryrefslogtreecommitdiff
path: root/Modules/CMakeCSharpCompilerId.cs.in
blob: b43ec043ec5ad08d36332c97d18ae767b196ffec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;

namespace CSharp
{
    public class CSharpApp
    {
        const string InfoCompiler = "INFO:compiler[Microsoft "
#if PlatformToolsetv100
        + "Visual Studio"
#elif PlatformToolsetv110
        + "Visual Studio"
#elif PlatformToolsetv120
        + "Visual Studio"
#elif PlatformToolsetv140
        + "Visual Studio"
#elif PlatformToolsetv141
        + "Visual Studio"
#elif PlatformToolsetv142
        + "Visual Studio"
#elif PlatformToolsetv143
        + "Visual Studio"
#else
        + "unknown"
#endif
        + "]";

        const string InfoPlatform = "INFO:platform[Windows]";

        const string InfoArchitecture = "INFO:arch["
#if Platformx64
        + "x64"
#elif Platformx86
        + "x86"
#elif PlatformxWin32
        + "Win32]"
#else
        + "unknown"
#endif
        + "]";

        const string InfoCompilerVersion = "INFO:compiler_version["
#if PlatformToolsetv100
        + "2010"
#elif PlatformToolsetv110
        + "2012"
#elif PlatformToolsetv120
        + "2013"
#elif PlatformToolsetv140
        + "2015"
#elif PlatformToolsetv141
        + "2017"
#elif PlatformToolsetv142
        + "2019"
#elif PlatformToolsetv143
        + "2022"
#else
        + "9999"
#endif
        + "]";

        static void Main(string[] args)
        {
            // we have to print the lines to make sure
            // the compiler does not optimize them away ...
            System.Console.WriteLine(InfoCompiler);
            System.Console.WriteLine(InfoPlatform);
            System.Console.WriteLine(InfoArchitecture);
            System.Console.WriteLine(InfoCompilerVersion);
        }
    }
}