2020-12-17 23:42:34 +01:00
|
|
|
"""Helper macro to compile and test code samples."""
|
|
|
|
|
|
|
|
|
|
def code_sample_cc(name):
|
2020-08-28 17:51:53 +02:00
|
|
|
native.cc_binary(
|
2020-12-17 23:42:34 +01:00
|
|
|
name = name,
|
|
|
|
|
srcs = [name + ".cc"],
|
2020-08-28 17:51:53 +02:00
|
|
|
deps = [
|
|
|
|
|
"//ortools/base",
|
|
|
|
|
"//ortools/linear_solver",
|
|
|
|
|
"//ortools/linear_solver:linear_solver_cc_proto",
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
2020-11-13 16:08:47 +01:00
|
|
|
native.cc_test(
|
2020-12-17 23:42:34 +01:00
|
|
|
name = name+"_test",
|
2020-11-13 16:08:47 +01:00
|
|
|
size = "small",
|
2020-12-17 23:42:34 +01:00
|
|
|
srcs = [name + ".cc"],
|
2020-11-13 16:08:47 +01:00
|
|
|
deps = [
|
2020-12-17 23:42:34 +01:00
|
|
|
":"+name,
|
2020-11-13 16:08:47 +01:00
|
|
|
"//ortools/base",
|
|
|
|
|
"//ortools/linear_solver",
|
|
|
|
|
"//ortools/linear_solver:linear_solver_cc_proto",
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|