exports.cpp 390 B

1234567891011121314151617181920212223
  1. // temporary workaround,
  2. // I was unable to figure out so far how to make cmake link a static library to
  3. // a shared one and export its symbols
  4. extern "C" {
  5. void PyInit_mcell();
  6. }
  7. // exported functions
  8. static volatile int x = 0;
  9. class UseSymbol {
  10. public:
  11. UseSymbol() {
  12. if (x != 0) {
  13. // make the symbol be used, but not called
  14. PyInit_mcell();
  15. }
  16. }
  17. };
  18. UseSymbol z;