first compiled example using bazel
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -28,3 +28,5 @@ examples/csharp/solution/*.csproj
|
||||
examples/csharp/*.sln
|
||||
|
||||
src/bazel-*
|
||||
examples/bazel-*
|
||||
|
||||
|
||||
44
examples/WORKSPACE
Normal file
44
examples/WORKSPACE
Normal file
@@ -0,0 +1,44 @@
|
||||
local_repository(
|
||||
name = "or_tools_libraries",
|
||||
path = "../src",
|
||||
)
|
||||
|
||||
git_repository(
|
||||
name = "com_github_gflags_gflags",
|
||||
commit = "f8a0efe03aa69b3336d8e228b37d4ccb17324b88",
|
||||
remote = "https://github.com/gflags/gflags.git",
|
||||
)
|
||||
|
||||
bind(
|
||||
name = "gflags",
|
||||
actual = "@com_github_gflags_gflags//:gflags",
|
||||
)
|
||||
|
||||
bind(
|
||||
name = "gflags_nothreads",
|
||||
actual = "@com_github_gflags_gflags//:gflags_nothreads",
|
||||
)
|
||||
|
||||
# proto_library rules implicitly depend on @com_google_protobuf//:protoc,
|
||||
# which is the proto-compiler.
|
||||
# This statement defines the @com_google_protobuf repo.
|
||||
http_archive(
|
||||
name = "com_google_protobuf",
|
||||
urls = ["https://github.com/google/protobuf/archive/b4b0e304be5a68de3d0ee1af9b286f958750f5e4.zip"],
|
||||
strip_prefix = "protobuf-b4b0e304be5a68de3d0ee1af9b286f958750f5e4",
|
||||
sha256 = "ff771a662fb6bd4d3cc209bcccedef3e93980a49f71df1e987f6afa3bcdcba3a",
|
||||
)
|
||||
|
||||
# cc_proto_library rules implicitly depend on @com_google_protobuf_cc//:cc_toolchain,
|
||||
# which is the C++ proto runtime (base classes and common utilities).
|
||||
http_archive(
|
||||
name = "com_google_protobuf_cc",
|
||||
urls = ["https://github.com/google/protobuf/archive/b4b0e304be5a68de3d0ee1af9b286f958750f5e4.zip"],
|
||||
strip_prefix = "protobuf-b4b0e304be5a68de3d0ee1af9b286f958750f5e4",
|
||||
sha256 = "ff771a662fb6bd4d3cc209bcccedef3e93980a49f71df1e987f6afa3bcdcba3a",
|
||||
)
|
||||
|
||||
bind(
|
||||
name = "protobuf",
|
||||
actual = "@com_google_protobuf_cc//:protobuf",
|
||||
)
|
||||
38
examples/cpp/BUILD
Normal file
38
examples/cpp/BUILD
Normal file
@@ -0,0 +1,38 @@
|
||||
cc_library(
|
||||
name = "jobshop_reader",
|
||||
hdrs = ["jobshop.h"],
|
||||
deps = [
|
||||
"@or_tools_libraries//base",
|
||||
"@or_tools_libraries//util",
|
||||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "flexible_jobshop_reader",
|
||||
hdrs = ["flexible_jobshop.h"],
|
||||
deps = [
|
||||
"@or_tools_libraries//base",
|
||||
"@or_tools_libraries//util",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
cc_binary(
|
||||
name = "jobshop_sat",
|
||||
srcs = [
|
||||
"jobshop_sat.cc",
|
||||
],
|
||||
deps = [
|
||||
":flexible_jobshop_reader",
|
||||
":jobshop_reader",
|
||||
"@or_tools_libraries//base",
|
||||
"@or_tools_libraries//util",
|
||||
"@or_tools_libraries//sat:disjunctive",
|
||||
"@or_tools_libraries//sat:integer",
|
||||
"@or_tools_libraries//sat:intervals",
|
||||
"@or_tools_libraries//sat:model",
|
||||
"@or_tools_libraries//sat:optimization",
|
||||
"@or_tools_libraries//sat:precedences",
|
||||
"@or_tools_libraries//sat:sat_solver",
|
||||
],
|
||||
)
|
||||
Reference in New Issue
Block a user