disable eglPlugin from setup.py / pip pybullet on Windows and Mac (only enable on Linux)
This commit is contained in:
@@ -62,6 +62,28 @@ B3_SHARED_API struct UrdfRenderingInterface* getRenderInterface_eglRendererPlugi
|
|||||||
|
|
||||||
|
|
||||||
#ifdef EGL_ADD_PYTHON_INIT
|
#ifdef EGL_ADD_PYTHON_INIT
|
||||||
|
|
||||||
|
static PyMethodDef eglMethods[] = {
|
||||||
|
{NULL, NULL, 0, NULL} /* Sentinel */
|
||||||
|
};
|
||||||
|
|
||||||
|
#if PY_MAJOR_VERSION >= 3
|
||||||
|
static struct PyModuleDef moduledef = {
|
||||||
|
PyModuleDef_HEAD_INIT, "eglRenderer", /* m_name */
|
||||||
|
"eglRenderer for PyBullet "
|
||||||
|
, /* m_doc */
|
||||||
|
-1, /* m_size */
|
||||||
|
eglMethods, /* m_methods */
|
||||||
|
NULL, /* m_reload */
|
||||||
|
NULL, /* m_traverse */
|
||||||
|
NULL, /* m_clear */
|
||||||
|
NULL, /* m_free */
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PyMODINIT_FUNC
|
PyMODINIT_FUNC
|
||||||
#if PY_MAJOR_VERSION >= 3
|
#if PY_MAJOR_VERSION >= 3
|
||||||
PyInit_eglRenderer(void)
|
PyInit_eglRenderer(void)
|
||||||
@@ -69,8 +91,20 @@ PyInit_eglRenderer(void)
|
|||||||
initeglRenderer(void)
|
initeglRenderer(void)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
|
||||||
|
PyObject* m;
|
||||||
#if PY_MAJOR_VERSION >= 3
|
#if PY_MAJOR_VERSION >= 3
|
||||||
return 0;
|
m = PyModule_Create(&moduledef);
|
||||||
|
#else
|
||||||
|
m = Py_InitModule3("eglRenderer", eglMethods, "eglRenderer for PyBullet");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if PY_MAJOR_VERSION >= 3
|
||||||
|
if (m == NULL) return m;
|
||||||
|
#else
|
||||||
|
if (m == NULL) return;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif //EGL_ADD_PYTHON_INIT
|
#endif //EGL_ADD_PYTHON_INIT
|
||||||
|
|||||||
29
setup.py
29
setup.py
@@ -42,7 +42,7 @@ CXX_FLAGS += '-DBT_USE_DOUBLE_PRECISION '
|
|||||||
CXX_FLAGS += '-DBT_ENABLE_ENET '
|
CXX_FLAGS += '-DBT_ENABLE_ENET '
|
||||||
CXX_FLAGS += '-DBT_ENABLE_CLSOCKET '
|
CXX_FLAGS += '-DBT_ENABLE_CLSOCKET '
|
||||||
CXX_FLAGS += '-DB3_DUMP_PYTHON_VERSION '
|
CXX_FLAGS += '-DB3_DUMP_PYTHON_VERSION '
|
||||||
|
CXX_FLAGS += '-DEGL_ADD_PYTHON_INIT '
|
||||||
EGL_CXX_FLAGS = ''
|
EGL_CXX_FLAGS = ''
|
||||||
|
|
||||||
|
|
||||||
@@ -535,12 +535,26 @@ print("packages")
|
|||||||
print(find_packages('examples/pybullet/gym'))
|
print(find_packages('examples/pybullet/gym'))
|
||||||
print("-----")
|
print("-----")
|
||||||
|
|
||||||
eglRender = Extension("eglRenderer",
|
extensions = []
|
||||||
|
|
||||||
|
pybullet_ext = Extension("pybullet",
|
||||||
|
sources = sources,
|
||||||
|
libraries = libraries,
|
||||||
|
extra_compile_args=CXX_FLAGS.split(),
|
||||||
|
include_dirs = include_dirs + ["src","examples/ThirdPartyLibs","examples/ThirdPartyLibs/glad", "examples/ThirdPartyLibs/enet/include","examples/ThirdPartyLibs/clsocket/src"]
|
||||||
|
)
|
||||||
|
extensions.append(pybullet_ext)
|
||||||
|
|
||||||
|
|
||||||
|
if 'BT_USE_EGL' in EGL_CXX_FLAGS:
|
||||||
|
|
||||||
|
eglRender = Extension("eglRenderer",
|
||||||
sources = egl_renderer_sources,
|
sources = egl_renderer_sources,
|
||||||
libraries = libraries,
|
libraries = libraries,
|
||||||
extra_compile_args=(CXX_FLAGS+EGL_CXX_FLAGS ).split(),
|
extra_compile_args=(CXX_FLAGS+EGL_CXX_FLAGS ).split(),
|
||||||
include_dirs = include_dirs + ["src","examples", "examples/ThirdPartyLibs","examples/ThirdPartyLibs/glad", "examples/ThirdPartyLibs/enet/include","examples/ThirdPartyLibs/clsocket/src"]
|
include_dirs = include_dirs + ["src","examples", "examples/ThirdPartyLibs","examples/ThirdPartyLibs/glad", "examples/ThirdPartyLibs/enet/include","examples/ThirdPartyLibs/clsocket/src"])
|
||||||
)
|
|
||||||
|
extensions.append(eglRender)
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
@@ -554,12 +568,7 @@ setup(
|
|||||||
license='zlib',
|
license='zlib',
|
||||||
platforms='any',
|
platforms='any',
|
||||||
keywords=['game development', 'virtual reality', 'physics simulation', 'robotics', 'collision detection', 'opengl'],
|
keywords=['game development', 'virtual reality', 'physics simulation', 'robotics', 'collision detection', 'opengl'],
|
||||||
ext_modules = [eglRender, Extension("pybullet",
|
ext_modules = extensions,
|
||||||
sources = sources,
|
|
||||||
libraries = libraries,
|
|
||||||
extra_compile_args=CXX_FLAGS.split(),
|
|
||||||
include_dirs = include_dirs + ["src","examples/ThirdPartyLibs","examples/ThirdPartyLibs/glad", "examples/ThirdPartyLibs/enet/include","examples/ThirdPartyLibs/clsocket/src"]
|
|
||||||
) ],
|
|
||||||
classifiers=['Development Status :: 5 - Production/Stable',
|
classifiers=['Development Status :: 5 - Production/Stable',
|
||||||
'License :: OSI Approved :: zlib/libpng License',
|
'License :: OSI Approved :: zlib/libpng License',
|
||||||
'Operating System :: Microsoft :: Windows',
|
'Operating System :: Microsoft :: Windows',
|
||||||
|
|||||||
Reference in New Issue
Block a user