2020-12-17 23:42:34 +01:00
|
|
|
"""Helper macro to compile and test code samples."""
|
|
|
|
|
|
|
|
|
|
def code_sample_cc(name):
|
2022-01-24 12:46:54 +01:00
|
|
|
native.cc_binary(
|
|
|
|
|
name = name,
|
|
|
|
|
srcs = [name + ".cc"],
|
|
|
|
|
deps = [
|
|
|
|
|
"//ortools/algorithms:knapsack_solver_lib",
|
|
|
|
|
],
|
|
|
|
|
)
|
2020-11-13 16:08:47 +01:00
|
|
|
|
2022-01-24 12:46:54 +01:00
|
|
|
native.cc_test(
|
|
|
|
|
name = name+"_test",
|
|
|
|
|
size = "small",
|
|
|
|
|
srcs = [name + ".cc"],
|
|
|
|
|
deps = [
|
|
|
|
|
":"+name,
|
|
|
|
|
"//ortools/algorithms:knapsack_solver_lib",
|
|
|
|
|
],
|
|
|
|
|
)
|