deps_shared_iface.cpp 886 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #ifndef CUSTOM_PROPERTY_IS_ON
  11. # error Expected CUSTOM_PROPERTY_IS_ON
  12. #endif
  13. #ifndef CUSTOM_STRING_IS_MATCH
  14. # error Expected CUSTOM_STRING_IS_MATCH
  15. #endif
  16. #ifdef TEST_SUBDIR_LIB
  17. # include "renamed.h"
  18. # include "subdir.h"
  19. #endif
  20. #ifdef DO_GNU_TESTS
  21. # ifndef CUSTOM_COMPILE_OPTION
  22. # error Expected CUSTOM_COMPILE_OPTION
  23. # endif
  24. #endif
  25. int main(int, char**)
  26. {
  27. TestSharedLibDepends dep;
  28. TestSharedLibRequired req;
  29. #ifdef TEST_SUBDIR_LIB
  30. SubDirObject sdo;
  31. Renamed ren;
  32. #endif
  33. return dep.foo() + req.foo()
  34. #ifdef TEST_SUBDIR_LIB
  35. + sdo.foo() + ren.foo()
  36. #endif
  37. ;
  38. }