You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
waf_old/playground/cython/cxx_lib/app.cxx

35 lines
738 B
C++

#include "Python.h"
#include <iostream>
#include "lib.h"
// cython function
#include "cy_cxxtest_api.h"
int main(int argc, char** argv)
{
std::cout << "::: cxx-app\n";
Py_Initialize();
if (!Py_IsInitialized()) {
std::cerr << ":: could not initialize python interpreter !\n";
return 1;
} else {
std::cout << ":: python initialized\n";
}
PyEval_InitThreads();
if (!PyEval_ThreadsInitialized()) {
std::cerr << ":: could not init GIL !\n";
return 1;
}
if (import_cy_cxxtest()) {
std::cerr << "** could not import 'cy_cxxtest' module !\n";
return 1;
} else {
std::cout << "::: successfully imported 'cy_cxxtest'\n";
}
cy_hello();
std::cout << "::: cxx-app [done]\n";
return 0;
}