Skip to content

Commit

Permalink
[eclipse-iceoryx#439] Create static and shared C++ libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Oct 11, 2024
1 parent c0c5571 commit ddd37b8
Show file tree
Hide file tree
Showing 13 changed files with 53 additions and 29 deletions.
16 changes: 11 additions & 5 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,23 @@ alias(
visibility = ["//visibility:public"],
)

# NOTE: the following lines can be removed once 'rules_foreign_cc' is retired from building the C and C++ bindings
alias(
name = "iceoryx2-cxx-shared",
actual = "//iceoryx2-ffi/cxx:iceoryx2-cxx-shared",
visibility = ["//visibility:public"],
)

alias(
name = "iceoryx2-c",
actual = "//iceoryx2-ffi/c:iceoryx2-c-foreigncc",
name = "iceoryx2-cxx-static",
actual = "//iceoryx2-ffi/cxx:iceoryx2-cxx-static",
visibility = ["//visibility:public"],
)

# NOTE: the following lines can be removed once 'rules_foreign_cc' is retired from building the C and C++ bindings

alias(
name = "iceoryx2-cxx",
actual = "//iceoryx2-ffi/cxx:iceoryx2-cxx",
name = "iceoryx2-c",
actual = "//iceoryx2-ffi/c:iceoryx2-c-foreigncc",
visibility = ["//visibility:public"],
)

Expand Down
4 changes: 2 additions & 2 deletions examples/c/event_multiplexing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cc_binary(
"src/wait.c",
],
deps = [
"//:iceoryx2-c",
"//:iceoryx2-c-static",
],
)

Expand All @@ -28,6 +28,6 @@ cc_binary(
"src/notifier.c",
],
deps = [
"//:iceoryx2-c",
"//:iceoryx2-c-static",
],
)
2 changes: 1 addition & 1 deletion examples/cxx/complex_data_types/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
],
)
2 changes: 1 addition & 1 deletion examples/cxx/discovery/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-shared",
],
)
6 changes: 3 additions & 3 deletions examples/cxx/domains/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
],
)

Expand All @@ -32,7 +32,7 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
],
)

Expand All @@ -43,6 +43,6 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
],
)
4 changes: 2 additions & 2 deletions examples/cxx/event/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
],
)

Expand All @@ -30,6 +30,6 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
],
)
4 changes: 2 additions & 2 deletions examples/cxx/event_multiplexing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
],
)

Expand All @@ -30,6 +30,6 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
],
)
4 changes: 2 additions & 2 deletions examples/cxx/publish_subscribe/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
],
)

Expand All @@ -32,6 +32,6 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
],
)
4 changes: 2 additions & 2 deletions examples/cxx/publish_subscribe_dynamic_data/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
],
)

Expand All @@ -30,6 +30,6 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
],
)
4 changes: 2 additions & 2 deletions examples/cxx/publish_subscribe_with_user_header/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
],
)

Expand All @@ -32,6 +32,6 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
],
)
6 changes: 3 additions & 3 deletions examples/cxx/service_attributes/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
],
)

Expand All @@ -30,7 +30,7 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
],
)

Expand All @@ -41,6 +41,6 @@ cc_binary(
],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
],
)
24 changes: 21 additions & 3 deletions iceoryx2-ffi/cxx/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,38 @@
#
# SPDX-License-Identifier: Apache-2.0 OR MIT

package(default_visibility = ["//visibility:public"])

load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")

cc_library(
name = "iceoryx2-cxx",
name = "iceoryx2-cxx-shared",
srcs = glob(
[
"src/**",
],
),
hdrs = glob(["include/**"]),
strip_include_prefix = "include",
deps = [
"//:iceoryx2-c-shared",
"@iceoryx//:iceoryx_hoofs",
],
linkstatic = False,
)

cc_library(
name = "iceoryx2-cxx-static",
srcs = glob(
[
"src/**",
],
),
hdrs = glob(["include/**"]),
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = [
"//:iceoryx2-c",
"//:iceoryx2-c-static",
"@iceoryx//:iceoryx_hoofs",
],
linkstatic = True,
)
2 changes: 1 addition & 1 deletion iceoryx2-ffi/cxx/tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cc_test(
visibility = ["//visibility:private"],
deps = [
"@iceoryx//:iceoryx_hoofs",
"//:iceoryx2-cxx",
"//:iceoryx2-cxx-static",
"@googletest//:gtest",
],
)

0 comments on commit ddd37b8

Please sign in to comment.