Skip to content

Commit

Permalink
feat: add fastcdr v2.2.2 (#2417)
Browse files Browse the repository at this point in the history
add fastcdr v2.2.2
  • Loading branch information
daohu527 authored Jul 15, 2024
1 parent 79f99a4 commit 74288cd
Show file tree
Hide file tree
Showing 6 changed files with 125 additions and 1 deletion.
9 changes: 9 additions & 0 deletions modules/fastcdr/2.2.2/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module(
name = "fastcdr",
version = "2.2.2",
compatibility_level = 1,
)

bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "cmake_configure_file", version = "0.1.0")
73 changes: 73 additions & 0 deletions modules/fastcdr/2.2.2/patches/add_build_file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
diff --git BUILD.bazel BUILD.bazel
new file mode 100644
index 0000000..4c584d4
--- /dev/null
+++ BUILD.bazel
@@ -0,0 +1,67 @@
+load("@rules_cc//cc:defs.bzl", "cc_library")
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+load(
+ "@cmake_configure_file//:cmake_configure_file.bzl",
+ "cmake_configure_file",
+)
+
+config_setting(
+ name = "osx_arm64",
+ constraint_values = [
+ "@platforms//os:osx",
+ "@platforms//cpu:arm64",
+ ],
+)
+
+cmake_configure_file(
+ name = "config",
+ src = "include/fastcdr/config.h.in",
+ out = "include/fastcdr/config.h",
+ cmakelists = [
+ "CMakeLists.txt",
+ ],
+ defines = [
+ "FASTCDR_HAVE_FLOAT128=0",
+ "FASTCDR_IS_BIG_ENDIAN_TARGET=0",
+ "HAVE_CXX11",
+ "PROJECT_VERSION=2.2.2",
+ "PROJECT_VERSION_MAJOR=2",
+ "PROJECT_VERSION_MINOR=2",
+ "PROJECT_VERSION_PATCH=2",
+ ] + select({
+ ":osx_arm64": [
+ "FASTCDR_SIZEOF_LONG_DOUBLE=8",
+ ],
+ "//conditions:default": [
+ "FASTCDR_SIZEOF_LONG_DOUBLE=16",
+ ],
+ }),
+ visibility = ["//visibility:private"],
+)
+
+cc_library(
+ name = "fastcdr",
+ hdrs = glob([
+ "include/**/*.h",
+ "include/**/*.hpp"
+ ]) + [
+ ":config",
+ ],
+ srcs = [
+ "src/cpp/Cdr.cpp",
+ "src/cpp/CdrSizeCalculator.cpp",
+ "src/cpp/FastCdr.cpp",
+ "src/cpp/FastBuffer.cpp",
+ "src/cpp/exceptions/BadOptionalAccessException.cpp",
+ "src/cpp/exceptions/BadParamException.cpp",
+ "src/cpp/exceptions/Exception.cpp",
+ "src/cpp/exceptions/LockedExternalAccessException.cpp",
+ "src/cpp/exceptions/NotEnoughMemoryException.cpp",
+ ],
+ strip_include_prefix = "include",
+ visibility = ["//visibility:public"],
+)
15 changes: 15 additions & 0 deletions modules/fastcdr/2.2.2/patches/module_dot_bazel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git MODULE.bazel MODULE.bazel
new file mode 100644
index 0000000..b696c5e
--- /dev/null
+++ MODULE.bazel
@@ -0,0 +1,9 @@
+module(
+ name = "fastcdr",
+ version = "2.2.2",
+ compatibility_level = 1,
+)
+
+bazel_dep(name = "platforms", version = "0.0.8")
+bazel_dep(name = "rules_cc", version = "0.0.9")
+bazel_dep(name = "cmake_configure_file", version = "0.1.0")
16 changes: 16 additions & 0 deletions modules/fastcdr/2.2.2/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
matrix:
platform:
- debian10
- ubuntu2004
- macos
- macos_arm64
- windows
bazel: [6.x, 7.x]

tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- '@fastcdr//:fastcdr'
10 changes: 10 additions & 0 deletions modules/fastcdr/2.2.2/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"integrity": "sha256-rot4ojwpKfJoE9eRdX0O9jpeR+AMz9NIJ0OvHoN9lVY=",
"patch_strip": 0,
"patches": {
"add_build_file.patch": "sha256-Zax6B4lZ5V1l0f42N82kqK3aMygHGI9yl7PW63JaCrs=",
"module_dot_bazel.patch": "sha256-Pv6D2U03Mf2Eh4skbEflA/k/g4Cnf5eQqKmScjc2cRk="
},
"strip_prefix": "Fast-CDR-2.2.2",
"url": "https://github.com/eProsima/Fast-CDR/archive/refs/tags/v2.2.2.tar.gz"
}
3 changes: 2 additions & 1 deletion modules/fastcdr/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"github:eProsima/Fast-CDR"
],
"versions": [
"2.1.3"
"2.1.3",
"2.2.2"
],
"yanked_versions": {}
}

0 comments on commit 74288cd

Please sign in to comment.