CMakeCSharpCompilerId.cs.in 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. #else
  18. + "unknown"
  19. #endif
  20. + "]";
  21. const string InfoPlatform = "INFO:platform[Windows]";
  22. const string InfoArchitecture = "INFO:arch["
  23. #if Platformx64
  24. + "x64"
  25. #elif Platformx86
  26. + "x86"
  27. #elif PlatformxWin32
  28. + "Win32]"
  29. #else
  30. + "unknown"
  31. #endif
  32. + "]";
  33. const string InfoCompilerVersion = "INFO:compiler_version["
  34. #if PlatformToolsetv100
  35. + "2010"
  36. #elif PlatformToolsetv110
  37. + "2012"
  38. #elif PlatformToolsetv120
  39. + "2013"
  40. #elif PlatformToolsetv140
  41. + "2015"
  42. #elif PlatformToolsetv141
  43. + "2017"
  44. #else
  45. + "9999"
  46. #endif
  47. + "]";
  48. static void Main(string[] args)
  49. {
  50. // we have to print the lines to make sure
  51. // the compiler does not optimize them away ...
  52. System.Console.WriteLine(InfoCompiler);
  53. System.Console.WriteLine(InfoPlatform);
  54. System.Console.WriteLine(InfoArchitecture);
  55. System.Console.WriteLine(InfoCompilerVersion);
  56. }
  57. }
  58. }