Skip to content

Commit 340f098

Browse files
authored
Merge pull request ERGO-Code#2492 from ERGO-Code/pr-2461
PR 2461 updated with latest
2 parents 2fb5d47 + 710642c commit 340f098

File tree

3 files changed

+38
-22
lines changed

3 files changed

+38
-22
lines changed

BUILD.bazel

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
2-
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_binary", "cc_test")
2+
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
33

44
copy_file(
55
name = "highs-config",
@@ -16,9 +16,8 @@ cc_library(
1616

1717
cc_library(
1818
name = "highs",
19-
srcs = glob([
19+
srcs = ["highs/interfaces/highs_c_api.cpp"] + glob([
2020
"extern/filereaderlp/*.cpp",
21-
"highs/interfaces/highs_c_api.cpp",
2221
"highs/io/*.cpp",
2322
"highs/ipm/*.cpp",
2423
"highs/ipm/ipx/*.cc",
@@ -35,18 +34,21 @@ cc_library(
3534
"highs/test_kkt/*.cpp",
3635
"highs/util/*.cpp",
3736
]),
38-
hdrs = glob([
39-
"**/*.h",
37+
hdrs = [
4038
"highs/mip/feasibilityjump.hh",
39+
] + glob([
40+
"**/*.h",
4141
"highs/qpsolver/*.hpp",
42-
"highs/Highs.h",
4342
"extern/filereaderlp/*.hpp",
4443
"extern/zstr/*.hpp",
4544
]),
46-
copts = [
47-
"-Wno-unused-variable",
48-
"-Wno-unused-but-set-variable",
49-
],
45+
copts = select({
46+
"@rules_cc//cc/compiler:msvc-cl": [],
47+
"//conditions:default": [
48+
"-Wno-unused-variable",
49+
"-Wno-unused-but-set-variable",
50+
],
51+
}),
5052
includes = [
5153
"extern",
5254
# "extern/filereaderlp",
@@ -66,7 +68,10 @@ cc_library(
6668
# "highs/util",
6769
"bazel-bin",
6870
],
69-
linkopts = ["-lpthread"],
71+
linkopts = select({
72+
"@rules_cc//cc/compiler:msvc-cl": ["-DEFAULTLIB:shell32.lib"],
73+
"//conditions:default": ["-lpthread"],
74+
}),
7075
visibility = ["//visibility:public"],
7176
deps = [
7277
"//:config",
@@ -76,8 +81,10 @@ cc_library(
7681

7782
cc_library(
7883
name = "highs-runtime-opts",
79-
hdrs = ["app/HighsRuntimeOptions.h",
80-
"app/CLI11.hpp"],
84+
hdrs = [
85+
"app/CLI11.hpp",
86+
"app/HighsRuntimeOptions.h",
87+
],
8188
visibility = ["//visibility:public"],
8289
deps = [
8390
"//:highs",
@@ -180,11 +187,13 @@ TEST_NAMES = [
180187
[cc_test(
181188
name = name,
182189
srcs = ["check/%s.cpp" % name],
183-
copts = [
184-
"-Iextern",
185-
"-Wno-unused-variable",
186-
"-Wno-unused-but-set-variable",
187-
],
190+
copts = ["-Iextern"] + select({
191+
"@rules_cc//cc/compiler:msvc-cl": [],
192+
"//conditions:default": [
193+
"-Wno-unused-variable",
194+
"-Wno-unused-but-set-variable",
195+
],
196+
}),
188197
deps = [
189198
":highs",
190199
":test_lib",

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ module(
77

88
bazel_dep(
99
name = "bazel_skylib",
10-
version = "1.7.1",
10+
version = "1.8.1",
1111
)
1212

1313
bazel_dep(
1414
name = "rules_cc",
15-
version = "0.0.16",
15+
version = "0.1.2",
1616
)
1717

1818
bazel_dep(
1919
name = "zlib",
20-
version = "1.3.1.bcr.3",
20+
version = "1.3.1.bcr.5",
2121
)

highs/HConfig.h.bazel.in

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@
88
#define HiGHSRELEASE
99
/* #undef HIGHSINT64 */
1010
/* #undef HIGHS_HAVE_MM_PAUSE */
11+
#ifdef __has_builtin
12+
#if __has_builtin(__builtin_clz) && __has_builtin(__builtin_clzll)
1113
#define HIGHS_HAVE_BUILTIN_CLZ
12-
/* #undef HIGHS_HAVE_BITSCAN_REVERSE */
14+
#endif
15+
#endif
16+
17+
#ifdef _MSC_VER
18+
#define HIGHS_HAVE_BITSCAN_REVERSE
19+
#endif
1320

1421
#define HIGHS_GITHASH "bdf95f2e0"
1522
#define HIGHS_VERSION_MAJOR 1

0 commit comments

Comments
 (0)