CMakeLists.txt 1.9 KB

123456789101112131415161718192021222324252627
  1. macro(shared_build_pass Source Message)
  2. build_pass("libshared.h" "libshared" "libshared" "${Source}" ${Message})
  3. endmacro()
  4. macro(shared_build_fail Source Message)
  5. build_fail("libshared.h" "libshared" "libshared" "${Source}" ${Message})
  6. endmacro()
  7. shared_build_pass("Libshared l; return l.libshared_exported();" "Failed to build exported")
  8. shared_build_fail("Libshared l; return l.libshared_deprecated();" "Built use of deprecated class method. This should not be possible.")
  9. if (COMPILER_HAS_HIDDEN_VISIBILITY)
  10. shared_build_fail("Libshared l; return l.libshared_excluded();" "Built use of excluded class method. This should not be possible.")
  11. else()
  12. # There is no MSVC equivalent to hiding symbols.
  13. shared_build_pass("Libshared l; return l.libshared_excluded();" "Built use of excluded class method. This is possible on MSVC.")
  14. endif()
  15. shared_build_fail("LibsharedNotExported l; return l.libshared();" "Built use of not-exported class method. This should not be possible.")
  16. shared_build_fail("LibsharedNotExported l; return l.libshared_not_exported();" "Built use of not-exported class method. This should not be possible.")
  17. shared_build_fail("LibsharedNotExported l; return l.libshared_excluded();" "Built use of not-exported class method. This should not be possible.")
  18. shared_build_fail("LibsharedExcluded l; return l.libshared();" "Built use of excluded class method. This should not be possible.")
  19. shared_build_fail("LibsharedExcluded l; return l.libshared_not_exported();" "Built use of excluded class method. This should not be possible.")
  20. shared_build_fail("LibsharedExcluded l; return l.libshared_excluded();" "Built use of excluded class method. This should not be possible.")
  21. shared_build_fail("return libshared_excluded();" "Built use of excluded function. This should not be possible.")
  22. shared_build_fail("return libshared_not_exported();" "Built use of not-exported function. This should not be possible.")