-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add qdldl Signed-off-by: wep21 <[email protected]> * update MODULE.bazel Signed-off-by: wep21 <[email protected]> * add cmake configure file patch Signed-off-by: wep21 <[email protected]> * update build file Signed-off-by: wep21 <[email protected]> * update MODULE.bazel Signed-off-by: wep21 <[email protected]> * remove linkstatic Signed-off-by: wep21 <[email protected]> --------- Signed-off-by: wep21 <[email protected]>
- Loading branch information
Showing
7 changed files
with
471 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module( | ||
name = "qdldl", | ||
version = "0.1.7", | ||
compatibility_level = 1, | ||
) | ||
|
||
bazel_dep(name = "platforms", version = "0.0.8") | ||
bazel_dep(name = "rules_cc", version = "0.0.9") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
diff --git BUILD.bazel BUILD.bazel | ||
new file mode 100644 | ||
index 0000000..aabba4f | ||
--- /dev/null | ||
+++ BUILD.bazel | ||
@@ -0,0 +1,64 @@ | ||
+load("@rules_cc//cc:defs.bzl", "cc_library") | ||
+ | ||
+load( | ||
+ "//bazel:cmake_configure_file.bzl", | ||
+ "cmake_configure_file", | ||
+) | ||
+ | ||
+licenses(["notice"]) | ||
+ | ||
+package( | ||
+ default_visibility = ["//visibility:public"], | ||
+) | ||
+ | ||
+cmake_configure_file( | ||
+ name = "configure_file_types", | ||
+ src = "configure/qdldl_types.h.in", | ||
+ out = "include/qdldl_types.h", | ||
+ # https://github.com/osqp/qdldl/blob/v0.1.6/README.md#custom-types-for-integer-floats-and-booleans | ||
+ defines = [ | ||
+ "QDLDL_BOOL_TYPE=unsigned char", | ||
+ # Keep the `int` type sync'd with the build of @osqp_internal and | ||
+ # @scs_internal. See drake/tools/workspace/qdldl_internal/README.md. | ||
+ "QDLDL_INT_TYPE=int", | ||
+ "QDLDL_LONG=0", | ||
+ # Keep the `int` type sync'd with the build of @osqp_internal and | ||
+ # @scs_internal. See drake/tools/workspace/qdldl_internal/README.md. | ||
+ "QDLDL_FLOAT_TYPE=double", | ||
+ "QDLDL_FLOAT=0", | ||
+ # Match this to QDLDL_INT_TYPE above. | ||
+ "QDLDL_INT_TYPE_MAX=INT_MAX", | ||
+ ], | ||
+ visibility = ["//visibility:private"], | ||
+) | ||
+ | ||
+cmake_configure_file( | ||
+ name = "configure_file_version", | ||
+ src = "configure/qdldl_version.h.in", | ||
+ out = "include/qdldl_version.h", | ||
+ cmakelists = [ | ||
+ "CMakeLists.txt", | ||
+ ], | ||
+ visibility = ["//visibility:private"], | ||
+) | ||
+ | ||
+cc_library( | ||
+ name = "qdldl", | ||
+ hdrs = [ | ||
+ "include/qdldl.h", | ||
+ ":include/qdldl_types.h", | ||
+ ":include/qdldl_version.h", | ||
+ ], | ||
+ srcs = [ | ||
+ "src/qdldl.c", | ||
+ ], | ||
+ copts = [ | ||
+ "-fvisibility=hidden", | ||
+ ] + select({ | ||
+ "@platforms//os:windows": [], | ||
+ "//conditions:default": ["-Werror=incompatible-pointer-types"], | ||
+ }), | ||
+ includes = [ | ||
+ "include", | ||
+ ], | ||
+) |
Oops, something went wrong.