compiletest.cpp 848 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef CMAKE_IS_FUN
  2. #error Expect CMAKE_IS_FUN definition
  3. #endif
  4. #if CMAKE_IS != Fun
  5. #error Expect CMAKE_IS=Fun definition
  6. #endif
  7. template<bool test>
  8. struct CMakeStaticAssert;
  9. template<>
  10. struct CMakeStaticAssert<true> {};
  11. static const char fun_string[] = CMAKE_IS_;
  12. #ifndef NO_SPACES_IN_DEFINE_VALUES
  13. static const char very_fun_string[] = CMAKE_IS_REALLY;
  14. #endif
  15. enum {
  16. StringLiteralTest1 = sizeof(CMakeStaticAssert<sizeof(CMAKE_IS_) == sizeof("Fun")>)
  17. #ifndef NO_SPACES_IN_DEFINE_VALUES
  18. ,
  19. StringLiteralTest2 = sizeof(CMakeStaticAssert<sizeof(CMAKE_IS_REALLY) == sizeof("Very Fun")>)
  20. #endif
  21. };
  22. #ifdef TEST_GENERATOR_EXPRESSIONS
  23. #ifndef CMAKE_IS_DECLARATIVE
  24. #error Expect declarative definition
  25. #endif
  26. #ifdef GE_NOT_DEFINED
  27. #error Expect not defined generator expression
  28. #endif
  29. #endif
  30. int main(int argc, char **argv)
  31. {
  32. return 0;
  33. }