Skip to content

Commit

Permalink
also link to abseil on win
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed May 18, 2023
1 parent a73a63a commit 92b4b1a
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 5 deletions.
1 change: 1 addition & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ source:
- patches/0003-adapt-to-name-of-protobuf-lib-on-windows.patch
- patches/0004-use-C-17-everywhere.patch
- patches/0005-set-PROTOBUF_USE_DLLS-clean-up-other-symbols-on-win.patch
- patches/0006-explicitly-link-to-abseil_dll-on-windows.patch

build:
number: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From cbe7b53095c6acf29abb65aee4b825f3235babf9 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Sun, 4 Sep 2022 18:14:41 +0200
Subject: [PATCH 1/5] do not link msvc runtime statically
Subject: [PATCH 1/6] do not link msvc runtime statically

---
python/setup.py | 4 ----
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From db8c830280ee0cf0a853d24a2e634728e224813b Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Sun, 4 Sep 2022 18:42:34 +0200
Subject: [PATCH 2/5] fix paths for include & lib directories
Subject: [PATCH 2/6] fix paths for include & lib directories

---
python/setup.py | 14 ++++++++++++--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From e893d9d92207989b1cc917564518545dd5615143 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Sun, 4 Sep 2022 19:42:16 +0200
Subject: [PATCH 3/5] adapt to name of protobuf lib on windows
Subject: [PATCH 3/6] adapt to name of protobuf lib on windows

---
python/setup.py | 3 ++-
Expand Down
2 changes: 1 addition & 1 deletion recipe/patches/0004-use-C-17-everywhere.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From f5c19b6bcb953106ffa3852f930f9906d9577490 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Thu, 18 May 2023 17:14:37 +1100
Subject: [PATCH 4/5] use C++17 everywhere
Subject: [PATCH 4/6] use C++17 everywhere

---
python/setup.py | 4 +++-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 1d7c0d7885178f0cfd9caab881559cfbdd2013e0 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Thu, 18 May 2023 18:49:27 +1100
Subject: [PATCH 5/5] set PROTOBUF_USE_DLLS; clean up other symbols on win
Subject: [PATCH 5/6] set PROTOBUF_USE_DLLS; clean up other symbols on win

---
python/setup.py | 7 ++-----
Expand Down
22 changes: 22 additions & 0 deletions recipe/patches/0006-explicitly-link-to-abseil_dll-on-windows.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From 6261ee512478a6ba826243b368dd7d35527f5b14 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Thu, 18 May 2023 19:20:35 +1100
Subject: [PATCH 6/6] explicitly link to abseil_dll on windows

---
python/setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/setup.py b/python/setup.py
index 897191d7b..bdd67a457 100755
--- a/python/setup.py
+++ b/python/setup.py
@@ -338,7 +338,7 @@ if __name__ == '__main__':
glob.iglob('../third_party/abseil-cpp/absl/**/*.a'))
else:
# our windows builds don't follow standard windows naming (i.e. have a lib prefix)
- libraries = ['protobuf'] if sys.platform != 'win32' else ['libprotobuf']
+ libraries = ['protobuf'] if sys.platform != 'win32' else ['libprotobuf', 'abseil_dll']
if HasLibraryDirsOpt():
library_dirs = None
elif os.path.exists('../bazel-bin/src/google/protobuf/libprotobuf.a'):

0 comments on commit 92b4b1a

Please sign in to comment.