Skip to content

Commit fe8a5a4

Browse files
committed
nsync: build shared library so it can be used as dependency
1 parent 8a22b03 commit fe8a5a4

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

Formula/n/nsync.rb

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ class Nsync < Formula
44
url "https://github.com/google/nsync/archive/refs/tags/1.29.2.tar.gz"
55
sha256 "1d63e967973733d2c97e841e3c05fac4d3fa299f01d14c86f2695594c7a4a2ec"
66
license "Apache-2.0"
7+
revision 1
78

89
bottle do
910
sha256 cellar: :any_skip_relocation, arm64_sequoia: "a3b52d87b9edb7d58f553ca104f219b34267f2a38f7b955b7f4e4583717ff8e7"
@@ -18,8 +19,11 @@ class Nsync < Formula
1819

1920
depends_on "cmake" => :build
2021

22+
# PR ref: https://github.com/google/nsync/pull/24
23+
patch :DATA
24+
2125
def install
22-
system "cmake", "-S", ".", "-B", "_build", "-DNSYNC_ENABLE_TESTS=OFF", *std_cmake_args
26+
system "cmake", "-S", ".", "-B", "_build", "-DBUILD_SHARED_LIBS=ON", "-DNSYNC_ENABLE_TESTS=OFF", *std_cmake_args
2327
system "cmake", "--build", "_build"
2428
system "cmake", "--install", "_build"
2529
end
@@ -42,3 +46,17 @@ def install
4246
system "./test"
4347
end
4448
end
49+
50+
__END__
51+
diff --git a/CMakeLists.txt b/CMakeLists.txt
52+
index fcc3f41..9dbe677 100644
53+
--- a/CMakeLists.txt
54+
+++ b/CMakeLists.txt
55+
@@ -125,7 +125,6 @@ elseif ("${CMAKE_SYSTEM_NAME}X" STREQUAL "DarwinX")
56+
${NSYNC_OS_CPP_SRC}
57+
"platform/c++11/src/nsync_semaphore_mutex.cc"
58+
"platform/posix/src/clock_gettime.c"
59+
- "platform/posix/src/nsync_semaphore_mutex.c"
60+
)
61+
elseif ("${CMAKE_SYSTEM_NAME}X" STREQUAL "LinuxX")
62+
set (NSYNC_POSIX ON)

0 commit comments

Comments
 (0)