deps_shared_iface.cpp 596 B

123456789101112131415161718192021222324252627282930313233
  1. #include "testSharedLibDepends.h"
  2. #ifdef CHECK_PIC_WORKS
  3. #if defined(__ELF__) && !defined(__PIC__) && !defined(__PIE__)
  4. #error Expected by INTERFACE_POSITION_INDEPENDENT_CODE property of dependency
  5. #endif
  6. #endif
  7. #ifndef PIC_PROPERTY_IS_ON
  8. #error Expected PIC_PROPERTY_IS_ON
  9. #endif
  10. #ifdef TEST_SUBDIR_LIB
  11. #include "subdir.h"
  12. #endif
  13. int main(int,char **)
  14. {
  15. TestSharedLibDepends dep;
  16. TestSharedLibRequired req;
  17. #ifdef TEST_SUBDIR_LIB
  18. SubDirObject sdo;
  19. #endif
  20. return dep.foo() + req.foo()
  21. #ifdef TEST_SUBDIR_LIB
  22. + sdo.foo()
  23. #endif
  24. ;
  25. }