Skip to content

Commit

Permalink
chore(bazel): add MODULE.bazel files for bzlmod
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
  • Loading branch information
mmorel-35 committed May 7, 2024
1 parent b29d344 commit 18ff9fc
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 22 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ qjh.mps

*.whl
bazel*
MODULE.bazel
MODULE.bazel.lock

# webdemo
Expand Down
45 changes: 24 additions & 21 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_binary", "cc_test")
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_binary", "cc_test")

copy_file(
name = "highs-config",
Expand All @@ -20,29 +20,30 @@ cc_library(
"extern/filereaderlp/*.cpp",
"extern/zlib/*.cpp",
"src/interfaces/highs_c_api.cpp",
"src/io/*.cpp",
"src/ipm/*.cpp",
"src/ipm/ipx/*.cc",
"src/ipm/basiclu/*.c",
"src/lp_data/*.cpp",
"src/mip/*.cpp",
"src/model/*.cpp",
"src/parallel/*.cpp",
"src/pdlp/*.cpp",
"src/pdlp/cupdlp/*.c",
"src/presolve/*.cpp",
"src/qpsolver/*.cpp",
"src/simplex/*.cpp",
"src/test/*.cpp",
"src/util/*.cpp",
"src/io/*.cpp",
"src/ipm/*.cpp",
"src/ipm/ipx/*.cc",
"src/ipm/basiclu/*.c",
"src/lp_data/*.cpp",
"src/mip/*.cpp",
"src/model/*.cpp",
"src/parallel/*.cpp",
"src/pdlp/*.cpp",
"src/pdlp/cupdlp/*.c",
"src/presolve/*.cpp",
"src/qpsolver/*.cpp",
"src/simplex/*.cpp",
"src/test/*.cpp",
"src/util/*.cpp",
]),
hdrs = glob([
"HConfig.h",
"**/*.h",
"src/qpsolver/*.hpp",
"src/Highs.h",
"extern/filereaderlp/*.hpp",
"extern/zstr/*.hpp"]),
"extern/zstr/*.hpp",
]),
copts = [
"-Wno-unused-variable",
"-Wno-unused-but-set-variable",
Expand All @@ -64,21 +65,23 @@ cc_library(
# "src/simplex",
# "src/test",
# "src/util",
"bazel-bin"],
"bazel-bin",
],
linkopts = ["-lpthread"],
visibility = ["//visibility:public"],
deps = [
deps = [
"//:config",
"@zlib",
],
)

cc_binary(
name = "call-highs-example",
srcs= ["examples/call_highs_from_cpp.cpp"],
srcs = ["examples/call_highs_from_cpp.cpp"],
visibility = ["//visibility:public"],
deps = [
"//:highs",
],
visibility = ["//visibility:public"]
)

## Add tests
Expand Down
17 changes: 17 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module(
name = "highs",
version = "0.0.0",
)

bazel_dep(
name = "bazel_skylib",
version = "1.6.1",
)
bazel_dep(
name = "rules_cc",
version = "0.0.9",
)
bazel_dep(
name = "zlib",
version = "1.3.1.bcr.1",
)

0 comments on commit 18ff9fc

Please sign in to comment.