Added python so generation rule.
This commit is contained in:
parent
d9f11e7d4a
commit
0a41fbc376
12
WORKSPACE
12
WORKSPACE
|
@ -299,3 +299,15 @@ maven_install(
|
|||
fetch_sources = True,
|
||||
version_conflict_policy = "pinned",
|
||||
)
|
||||
|
||||
new_local_repository(
|
||||
name = "python_dev",
|
||||
path = "/home/yusuke/miniconda3/envs/py37_ubuntu_vtuber/include/python3.7m",
|
||||
build_file_content = """
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
cc_library(
|
||||
name = "headers",
|
||||
hdrs = glob(["**/*.h"])
|
||||
)
|
||||
"""
|
||||
)
|
|
@ -76,3 +76,17 @@ cc_library(
|
|||
"//mediapipe/calculators/core:packet_cloner_calculator"
|
||||
],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "cameravtuber.so",
|
||||
linkshared = 1,
|
||||
srcs = [
|
||||
"cameravtuber.cc"
|
||||
],
|
||||
deps = [
|
||||
":demo_run_graph_main_gpu",
|
||||
"@python_dev//:headers"
|
||||
],
|
||||
copts = ["-Iexternal/python_dev", "-DPIC", "-shared", "-fPIC"],
|
||||
linkopts = ["-lboost_python3"]
|
||||
)
|
10
mediapipe/examples/desktop/cameravtuber.cc
Normal file
10
mediapipe/examples/desktop/cameravtuber.cc
Normal file
|
@ -0,0 +1,10 @@
|
|||
#include <boost/python.hpp>
|
||||
|
||||
std::string hello() {
|
||||
return "hello world";
|
||||
}
|
||||
|
||||
BOOST_PYTHON_MODULE(cameravtuber) {
|
||||
using namespace boost::python;
|
||||
def("hello", &hello);
|
||||
}
|
Loading…
Reference in New Issue
Block a user