Skip to content

Commit

Permalink
Modify "linkopts" for "websocketpp" depending on the operating system.
Browse files Browse the repository at this point in the history
This change fixes the build on Mac OS X. According to the original CMakeLists.txt, "rt" is not linked on Mac OS X.

        if (NOT APPLE)
            set (WEBSOCKETPP_PLATFORM_LIBS pthread rt)
        else()
            set (WEBSOCKETPP_PLATFORM_LIBS pthread)
        endif()
  • Loading branch information
carbo-asr committed Jul 5, 2024
1 parent a7c42e8 commit e0c70f7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions modules/websocketpp/0.8.2/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ module(
bazel_dep(name = "asio", version = "1.28.2")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "zlib", version = "1.3")
bazel_dep(name = "platforms", version = "0.0.10")
15 changes: 10 additions & 5 deletions modules/websocketpp/0.8.2/patches/add_build_file.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- /dev/null
+++ BUILD.bazel
@@ -0,0 +1,20 @@
@@ -0,0 +1,25 @@
+load("@rules_cc//cc:defs.bzl", "cc_library")
+
+cc_library(
Expand All @@ -11,10 +11,15 @@
+ "_WEBSOCKETPP_CPP11_STL_",
+ ],
+ includes = ["."],
+ linkopts = [
+ "-lpthread",
+ "-lrt",
+ ],
+ linkopts = select({
+ "@platforms//os:osx": [
+ "-lpthread",
+ ],
+ "//conditions:default": [
+ "-lpthread",
+ "-lrt",
+ ],
+ }),
+ visibility = ["//visibility:public"],
+ deps = [
+ "@asio",
Expand Down
3 changes: 2 additions & 1 deletion modules/websocketpp/0.8.2/patches/module_dot_bazel.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- /dev/null
+++ MODULE.bazel
@@ -0,0 +1,8 @@
@@ -0,0 +1,9 @@
+module(
+ name = "websocketpp",
+ version = "0.8.2",
Expand All @@ -9,3 +9,4 @@
+bazel_dep(name = "asio", version = "1.28.2")
+bazel_dep(name = "rules_cc", version = "0.0.9")
+bazel_dep(name = "zlib", version = "1.3")
+bazel_dep(name = "platforms", version = "0.0.10")

0 comments on commit e0c70f7

Please sign in to comment.