CMakeCSharpCompilerId.cs.in 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using System;
  2. namespace CSharp
  3. {
  4. public class CSharpApp
  5. {
  6. const string InfoCompiler = "INFO:compiler[Microsoft "
  7. #if PlatformToolsetv100
  8. + "Visual Studio"
  9. #elif PlatformToolsetv110
  10. + "Visual Studio"
  11. #elif PlatformToolsetv120
  12. + "Visual Studio"
  13. #elif PlatformToolsetv140
  14. + "Visual Studio"
  15. #elif PlatformToolsetv141
  16. + "Visual Studio"
  17. #elif PlatformToolsetv142
  18. + "Visual Studio"
  19. #elif PlatformToolsetv143
  20. + "Visual Studio"
  21. #elif PlatformToolsetv145
  22. + "Visual Studio"
  23. #else
  24. + "unknown"
  25. #endif
  26. + "]";
  27. const string InfoPlatform = "INFO:platform[Windows]";
  28. const string InfoArchitecture = "INFO:arch["
  29. #if Platformx64
  30. + "x64"
  31. #elif Platformx86
  32. + "x86"
  33. #elif PlatformxWin32
  34. + "Win32]"
  35. #else
  36. + "unknown"
  37. #endif
  38. + "]";
  39. const string InfoCompilerVersion = "INFO:compiler_version["
  40. #if PlatformToolsetv100
  41. + "2010"
  42. #elif PlatformToolsetv110
  43. + "2012"
  44. #elif PlatformToolsetv120
  45. + "2013"
  46. #elif PlatformToolsetv140
  47. + "2015"
  48. #elif PlatformToolsetv141
  49. + "2017"
  50. #elif PlatformToolsetv142
  51. + "2019"
  52. #elif PlatformToolsetv143
  53. + "2022"
  54. #elif PlatformToolsetv145
  55. + "2026"
  56. #else
  57. + "9999"
  58. #endif
  59. + "]";
  60. static void Main(string[] args)
  61. {
  62. // we have to print the lines to make sure
  63. // the compiler does not optimize them away ...
  64. System.Console.WriteLine(InfoCompiler);
  65. System.Console.WriteLine(InfoPlatform);
  66. System.Console.WriteLine(InfoArchitecture);
  67. System.Console.WriteLine(InfoCompilerVersion);
  68. }
  69. }
  70. }