Skip to content

Commit 6091071

Browse files
committed
Remove abseil dependency and update build scripts
Abseil has been removed from the dependency list in vcpkg.json and related CMake configuration. Patch handling for abseil and protobuf portfiles is now conditional on the target platform, improving compatibility with Emscripten. References to absl::log_internal_check_op have been removed from build targets.
1 parent bf6e3c5 commit 6091071

File tree

4 files changed

+31
-13
lines changed

4 files changed

+31
-13
lines changed

browser/overlay-ports/abseil/portfile.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@ if(NOT VCPKG_TARGET_IS_WINDOWS)
22
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
33
endif()
44

5+
set(ABSEIL_PATCHES)
6+
if(NOT VCPKG_TARGET_IS_EMSCRIPTEN)
7+
list(APPEND ABSEIL_PATCHES use_pthread.patch)
8+
endif()
9+
510
vcpkg_from_github(
611
OUT_SOURCE_PATH SOURCE_PATH
712
REPO abseil/abseil-cpp
813
REF "${VERSION}"
914
SHA512 bd2cca8f007f2eee66f51c95a979371622b850ceb2ce3608d00ba826f7c494a1da0fba3c1427728f2c173fe50d59b701da35c2c9fdad2752a5a49746b1c8ef31
1015
HEAD_REF master
1116
PATCHES
12-
use_pthread.patch
17+
${ABSEIL_PATCHES}
1318
)
1419

1520
# With ABSL_PROPAGATE_CXX_STD=ON abseil automatically detect if it is being

browser/overlay-ports/protobuf/portfile.cmake

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1+
set(PROTOBUF_PATCHES
2+
fix-static-build.patch
3+
fix-default-proto-file-path.patch
4+
fix-utf8-range.patch
5+
fix-arm64-msvc.patch
6+
)
7+
if(NOT VCPKG_TARGET_IS_EMSCRIPTEN)
8+
list(APPEND PROTOBUF_PATCHES use_pthread.patch)
9+
endif()
10+
111
vcpkg_from_github(
212
OUT_SOURCE_PATH SOURCE_PATH
313
REPO protocolbuffers/protobuf
414
REF "v${VERSION}"
515
SHA512 ce81add9d978a6b63d4205715eac5084e81a6753da1f6c6bad6493e60253215901bffc4a60d704a873333f2b9f94fd86cb7eb5b293035f2268c12692bd808bac
616
HEAD_REF master
717
PATCHES
8-
use_pthread.patch
9-
fix-static-build.patch
10-
fix-default-proto-file-path.patch
11-
fix-utf8-range.patch
12-
fix-arm64-msvc.patch
18+
${PROTOBUF_PATCHES}
1319
)
1420

1521
string(COMPARE EQUAL "${TARGET_TRIPLET}" "${HOST_TRIPLET}" protobuf_BUILD_PROTOC_BINARIES)

src/CMakeLists.txt

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,24 @@ find_package(OpenSSL QUIET)
124124
find_package(PhysFS REQUIRED)
125125
find_package(ZLIB REQUIRED)
126126
find_package(phmap REQUIRED)
127-
find_package(absl CONFIG REQUIRED)
128127
find_package(Protobuf REQUIRED)
129128
find_package(LibLZMA REQUIRED)
130129
find_package(nlohmann_json REQUIRED)
131130
find_package(asio REQUIRED)
132-
find_package(Threads REQUIRED)
131+
if(WASM)
132+
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
133+
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
134+
find_package(Threads)
135+
if(NOT Threads_FOUND)
136+
add_library(Threads::Threads INTERFACE IMPORTED)
137+
target_compile_options(Threads::Threads INTERFACE -pthread)
138+
target_link_options(Threads::Threads INTERFACE -pthread)
139+
set(CMAKE_THREAD_LIBS_INIT "-pthread")
140+
set(Threads_FOUND TRUE)
141+
endif()
142+
else()
143+
find_package(Threads REQUIRED)
144+
endif()
133145
find_package(STDUUID CONFIG REQUIRED)
134146
find_package(pugixml CONFIG REQUIRED)
135147
find_package(ZLIB REQUIRED)
@@ -542,7 +554,6 @@ if(MSVC)
542554
${STDUUID}
543555

544556
protobuf::libprotobuf protobuf
545-
absl::log_internal_check_op
546557
Threads::Threads
547558
GLEW::GLEW
548559
asio::asio
@@ -587,7 +598,6 @@ elseif(ANDROID)
587598
${MINIZIP_LIBRARY}
588599

589600
protobuf::libprotobuf protobuf
590-
absl::log_internal_check_op
591601
Threads::Threads
592602
asio::asio
593603
OpenSLES
@@ -640,7 +650,6 @@ elseif(WASM)
640650
${HTTPLIB_LIBRARY}
641651

642652
protobuf::libprotobuf protobuf
643-
absl::log_internal_check_op
644653

645654
Threads::Threads
646655
asio::asio
@@ -724,7 +733,6 @@ else() # Linux
724733
${HTTPLIB_LIBRARY}
725734

726735
protobuf::libprotobuf protobuf
727-
absl::log_internal_check_op
728736
Threads::Threads
729737
X11::X11
730738
asio::asio

vcpkg.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"version-string": "1.0.0",
44
"dependencies": [
55
"asio",
6-
"abseil",
76
"cpp-httplib",
87
"cppcodec",
98
"discord-rpc",

0 commit comments

Comments
 (0)