Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: browser support #894

Merged
merged 82 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
02ca37f
browser support
IvanClementino Oct 2, 2024
7b789be
Merge branch 'main' into browser
mehah Oct 2, 2024
791ef9d
Merge branch 'main' into browser
Nottinghster Oct 2, 2024
8a5624d
CMake: WASM should be tested and else left for Linux as before
IvanClementino Oct 3, 2024
f5e2e21
Merge branch 'mehah:main' into browser
OTArchive Oct 3, 2024
b5dbba2
Merge branch 'mehah:main' into browser
OTArchive Oct 4, 2024
507c560
Merge branch 'mehah:main' into browser
OTArchive Oct 4, 2024
9ac9b84
Remove conflicting vcpkg.json files
IvanClementino Oct 4, 2024
8480d20
Use existing base64 encoder
IvanClementino Oct 4, 2024
2f659bd
Check for emscripten before includes and declarations
IvanClementino Oct 4, 2024
bb34371
Improve CMakeLists
IvanClementino Oct 4, 2024
aab3407
Fix case-sensitivity issues
IvanClementino Oct 4, 2024
211da69
Merge branch 'main' into browser
luanluciano93 Oct 5, 2024
628f49c
Merge branch 'mehah:main' into browser
OTArchive Oct 5, 2024
d6ac1f9
Implement bitlib and restore original .lua files bit operations
IvanClementino Oct 5, 2024
c614336
Merge branch 'mehah:main' into browser
OTArchive Oct 6, 2024
20bcc3a
Merge branch 'mehah:main' into browser
OTArchive Oct 6, 2024
17e8375
Merge branch 'mehah:main' into browser
OTArchive Oct 6, 2024
deef922
Support older protocols and improvements
IvanClementino Oct 7, 2024
9e38012
Merge branch 'mehah:main' into browser
OTArchive Oct 7, 2024
e301e05
Set correct numpad keys
IvanClementino Oct 7, 2024
f7185d1
Intercept all browser keys
IvanClementino Oct 7, 2024
7ef45fb
Allow pasting and writing symbols with shift
IvanClementino Oct 8, 2024
5d003aa
Merge branch 'mehah:main' into browser
OTArchive Oct 9, 2024
bfed59b
Improve networking
IvanClementino Oct 9, 2024
40e075a
Reload page on client exit
IvanClementino Oct 9, 2024
9df1b90
Reduce CPU usage and connection improvements
IvanClementino Oct 10, 2024
0aaa93d
Disable Emscripten's text decoder
IvanClementino Oct 10, 2024
d5b90a2
Merge branch 'mehah:main' into browser
OTArchive Oct 12, 2024
9fcbcfd
Basic mobile support
IvanClementino Oct 12, 2024
179c76d
Merge branch 'main' into browser
luanluciano93 Oct 12, 2024
017325c
Merge branch 'mehah:main' into browser
OTArchive Oct 13, 2024
3c6bc5a
Improve performance
IvanClementino Oct 13, 2024
f1c2ce0
Merge branch 'mehah:main' into browser
OTArchive Oct 13, 2024
4fd167f
Merge branch 'mehah:main' into browser
OTArchive Oct 14, 2024
4bd3dbe
Merge branch 'mehah:main' into browser
OTArchive Oct 14, 2024
e3b0a13
Case insensitive FS and properly return if websocket fails to be created
IvanClementino Oct 14, 2024
0a20f03
Fix Vorbis Linking (7cd3c82)
IvanClementino Oct 14, 2024
ec2c4e6
Allow gameWorld port to be set without rebuilding
IvanClementino Oct 14, 2024
667b37c
Merge branch 'mehah:main' into browser
OTArchive Oct 15, 2024
7f1b778
Merge branch 'mehah:main' into browser
OTArchive Oct 15, 2024
3048c56
Merge branch 'mehah:main' into browser
OTArchive Oct 15, 2024
7147164
Merge branch 'mehah:main' into browser
OTArchive Oct 16, 2024
59c3dd3
Merge branch 'mehah:main' into browser
OTArchive Oct 16, 2024
afba916
Merge branch 'mehah:main' into browser
OTArchive Oct 17, 2024
235f22b
Remove unused definition
IvanClementino Oct 18, 2024
7e3ae66
Remove '&'
IvanClementino Oct 18, 2024
4481ece
Remove swapBuffers call, we no longer use it
IvanClementino Oct 18, 2024
244d1d4
Properly encode json
IvanClementino Oct 18, 2024
afae5db
Update src/framework/net/webconnection.cpp
OTArchive Oct 18, 2024
87bccbf
Update src/framework/net/webconnection.cpp
OTArchive Oct 18, 2024
425f712
Update src/framework/net/webconnection.cpp
OTArchive Oct 18, 2024
1c4a835
Update src/framework/platform/browserplatform.cpp
OTArchive Oct 18, 2024
75f69ea
Update src/framework/platform/browserplatform.cpp
OTArchive Oct 18, 2024
2acc468
Update src/framework/platform/browserplatform.cpp
OTArchive Oct 18, 2024
b490cd1
Update src/framework/platform/browserplatform.cpp
OTArchive Oct 18, 2024
d580f27
c++17 remove file
IvanClementino Oct 18, 2024
f0d403e
Merge branch 'mehah:main' into browser
OTArchive Oct 18, 2024
e28420b
Merge branch 'mehah:main' into browser
OTArchive Oct 18, 2024
543482a
Recommended improvements
IvanClementino Oct 19, 2024
01c750d
Merge branch 'mehah:main' into browser
OTArchive Oct 19, 2024
4eed1a1
Merge branch 'mehah/main' into browser
IvanClementino Oct 22, 2024
fbc8887
Merge branch 'mehah:main' into browser
OTArchive Oct 25, 2024
dfd6d79
Merge branch 'mehah:main' into browser
OTArchive Oct 28, 2024
0ec4f8a
Remove uneeded link libs
IvanClementino Oct 28, 2024
f1f9046
remove regex
IvanClementino Oct 28, 2024
89c8d2f
Merge branch 'mehah:main' into browser
OTArchive Oct 29, 2024
2026960
Cleanup shell.html
IvanClementino Oct 29, 2024
aa27044
Make compiling easier
IvanClementino Oct 29, 2024
e59f844
Add baseline to overlay-ports vcpkg.json files
IvanClementino Oct 29, 2024
1858ab9
Workflows: ignore overlay-ports vcpkg.json
IvanClementino Oct 29, 2024
af77e53
Merge branch 'mehah:main' into browser
OTArchive Oct 29, 2024
5d62b82
Bot V8 basic fixes
IvanClementino Oct 30, 2024
5b5019e
Merge branch 'mehah:main' into browser
OTArchive Nov 3, 2024
8e80533
Merge branch 'mehah:main' into browser
OTArchive Nov 8, 2024
a9dc380
Merge branch 'mehah:main' into browser
OTArchive Nov 13, 2024
cb275d7
Merge branch 'mehah:main' into browser
OTArchive Nov 17, 2024
9ba596b
Merge branch 'mehah:main' into browser
OTArchive Nov 18, 2024
e2b5416
Merge branch 'mehah:main' into browser
OTArchive Nov 21, 2024
d1d7ee7
Merge branch 'mehah:main' into browser
OTArchive Nov 26, 2024
eb60681
Merge branch 'mehah:main' into browser
OTArchive Nov 28, 2024
eeab378
Merge branch 'main' into browser
mehah Nov 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/analysis-sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
with:
vcpkgGitURL: "https://github.com/microsoft/vcpkg.git"
vcpkgGitCommitId: ${{ steps.vcpkg-step.outputs.vcpkgGitCommitId }}
vcpkgJsonIgnores: "['**/vcpkg/**', '**/browser/overlay-ports/**']"

- name: Install sonar-scanner
uses: SonarSource/sonarcloud-github-c-cpp@v1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
uses: lukka/run-vcpkg@main
with:
vcpkgGitCommitId: ${{ steps.vcpkg-step.outputs.vcpkgGitCommitId }}
vcpkgJsonIgnores: "['**/vcpkg/**', '**/browser/overlay-ports/**']"

- name: Get latest CMake and ninja
uses: lukka/get-cmake@main
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
with:
vcpkgGitURL: "https://github.com/microsoft/vcpkg.git"
vcpkgGitCommitId: ${{ steps.vcpkg-step.outputs.vcpkgGitCommitId }}
vcpkgJsonIgnores: "['**/vcpkg/**', '**/browser/overlay-ports/**']"

- name: Get latest CMake and ninja
uses: lukka/get-cmake@main
Expand Down
20 changes: 20 additions & 0 deletions browser/include/bitlib/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
bitlib
------

by Reuben Thomas <[email protected]>
http://luaforge.net/projects/bitlib


bitlib is a C library for Lua 5.1 that provides bitwise operations. It
is copyright Reuben Thomas 2000-2009, and is released under the MIT
license, like Lua (see http://www.lua.org/copyright.html; it's
basically the same as the BSD license). There is no warranty.

Please report bugs and make suggestions to the email address above, or
use the LuaForge trackers.

Thanks to John Passaniti for his bitwise operations library, some of
whose ideas I used, to Shmuel Zeigerman for the test suite, to
Thatcher Ulrich for portability fixes, and to Enrico Tassi, John
Stiles and Eduardo Ochs for bug reports.

4 changes: 4 additions & 0 deletions browser/include/bitlib/bit_limits.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#define BITLIB_FLOAT_BITS 53
#define BITLIB_FLOAT_MAX 0xfffffffffffffL
#define BITLIB_FLOAT_MIN (-0x10000000000000L)
#define BITLIB_FLOAT_UMAX 0x1fffffffffffffUL
129 changes: 129 additions & 0 deletions browser/include/bitlib/lbitlib.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/* Bitwise operations library */
/* (c) Reuben Thomas 2000-2008 */
/* See README for license */

#include "bit_limits.h"


/* FIXME: Assumes lua_Integer is ptrdiff_t */
#define LUA_INTEGER_MAX PTRDIFF_MAX
#define LUA_INTEGER_MIN PTRDIFF_MIN

/* FIXME: Assumes size_t is an unsigned lua_Integer */
typedef size_t lua_UInteger;
#define LUA_UINTEGER_MAX SIZE_MAX


/* Bit type size and limits */

#define BIT_BITS \
(CHAR_BIT * sizeof(lua_Integer) > BITLIB_FLOAT_BITS ? \
BITLIB_FLOAT_BITS : (CHAR_BIT * sizeof(lua_Integer)))

/* This code may give warnings if BITLIB_FLOAT_* are too big to fit in
long, but that doesn't matter since in that case they won't be
used. */
#define BIT_MAX \
(CHAR_BIT * sizeof(lua_Integer) > BITLIB_FLOAT_BITS ? BITLIB_FLOAT_MAX : LUA_INTEGER_MAX)

#define BIT_MIN \
(CHAR_BIT * sizeof(lua_Integer) > BITLIB_FLOAT_BITS ? BITLIB_FLOAT_MIN : LUA_INTEGER_MIN)

#define BIT_UMAX \
(CHAR_BIT * sizeof(lua_Integer) > BITLIB_FLOAT_BITS ? BITLIB_FLOAT_UMAX : LUA_UINTEGER_MAX)


/* Define TOBIT to get a bit value */
#ifdef BUILTIN_CAST
#define
#define TOBIT(L, n, res) \
((void)(res), luaL_checkinteger((L), (n)))
#else
#include <stdint.h>
#include <math.h>

/* FIXME: Assumes lua_Number fits in a double (use of fmod). */
#define TOBIT(L, n, res) \
((lua_Integer)(((res) = fmod(luaL_checknumber(L, (n)), (double)BIT_UMAX + 1.0)), \
(res) > BIT_MAX ? ((res) -= (double)BIT_UMAX, (res) -= 1) : \
((res) < BIT_MIN ? ((res) += (double)BIT_UMAX, (res) += 1) : (res))))
#endif


#define BIT_TRUNCATE(i) \
((i) & BIT_UMAX)


/* Operations

The macros MONADIC and VARIADIC only deal with bitwise operations.

LOGICAL_SHIFT truncates its left-hand operand before shifting so
that any extra bits at the most-significant end are not shifted
into the result.

ARITHMETIC_SHIFT does not truncate its left-hand operand, so that
the sign bits are not removed and right shift work properly.
*/

#define MONADIC(name, op) \
static int bit_ ## name(lua_State *L) { \
lua_Number f; \
lua_pushinteger(L, BIT_TRUNCATE(op TOBIT(L, 1, f))); \
return 1; \
}

#define VARIADIC(name, op) \
static int bit_ ## name(lua_State *L) { \
lua_Number f; \
int n = lua_gettop(L), i; \
lua_Integer w = TOBIT(L, 1, f); \
for (i = 2; i <= n; i++) \
w op TOBIT(L, i, f); \
lua_pushinteger(L, BIT_TRUNCATE(w)); \
return 1; \
}

#define LOGICAL_SHIFT(name, op) \
static int bit_ ## name(lua_State *L) { \
lua_Number f; \
lua_pushinteger(L, BIT_TRUNCATE(BIT_TRUNCATE((lua_UInteger)TOBIT(L, 1, f)) op \
(unsigned)luaL_checknumber(L, 2))); \
return 1; \
}

#define ARITHMETIC_SHIFT(name, op) \
static int bit_ ## name(lua_State *L) { \
lua_Number f; \
lua_pushinteger(L, BIT_TRUNCATE((lua_Integer)TOBIT(L, 1, f) op \
(unsigned)luaL_checknumber(L, 2))); \
return 1; \
}

MONADIC(cast, +)
MONADIC(bnot, ~)
VARIADIC(band, &=)
VARIADIC(bor, |=)
VARIADIC(bxor, ^=)
ARITHMETIC_SHIFT(lshift, <<)
LOGICAL_SHIFT(rshift, >>)
ARITHMETIC_SHIFT(arshift, >>)

static const struct luaL_reg bitlib[] = {
{"cast", bit_cast},
{"bnot", bit_bnot},
{"band", bit_band},
{"bor", bit_bor},
{"bxor", bit_bxor},
{"lshift", bit_lshift},
{"rshift", bit_rshift},
{"arshift", bit_arshift},
{NULL, NULL}
};

LUALIB_API int luaopen_bit (lua_State *L) {
luaL_register(L, "bit", bitlib);
lua_pushnumber(L, BIT_BITS);
lua_setfield(L, -2, "bits");
return 1;
}
55 changes: 55 additions & 0 deletions browser/overlay-ports/abseil/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
if(NOT VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO abseil/abseil-cpp
REF "${VERSION}"
SHA512 bd2cca8f007f2eee66f51c95a979371622b850ceb2ce3608d00ba826f7c494a1da0fba3c1427728f2c173fe50d59b701da35c2c9fdad2752a5a49746b1c8ef31
HEAD_REF master
PATCHES
use_pthread.patch
)

# With ABSL_PROPAGATE_CXX_STD=ON abseil automatically detect if it is being
# compiled with C++14 or C++17, and modifies the installed `absl/base/options.h`
# header accordingly. This works even if CMAKE_CXX_STANDARD is not set. Abseil
# uses the compiler default behavior to update `absl/base/options.h` as needed.
set(ABSL_USE_CXX17_OPTION "")
if("cxx17" IN_LIST FEATURES)
set(ABSL_USE_CXX17_OPTION "-DCMAKE_CXX_STANDARD=17")
endif()

set(ABSL_STATIC_RUNTIME_OPTION "")
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_CRT_LINKAGE STREQUAL "static")
set(ABSL_STATIC_RUNTIME_OPTION "-DABSL_MSVC_STATIC_RUNTIME=ON")
endif()

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
DISABLE_PARALLEL_CONFIGURE
OPTIONS
-DABSL_PROPAGATE_CXX_STD=ON
${ABSL_USE_CXX17_OPTION}
${ABSL_STATIC_RUNTIME_OPTION}
)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME absl CONFIG_PATH lib/cmake/absl)
vcpkg_fixup_pkgconfig()

vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/include/absl/copts"
"${CURRENT_PACKAGES_DIR}/include/absl/strings/testdata"
"${CURRENT_PACKAGES_DIR}/include/absl/time/internal/cctz/testdata"
)

if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/absl/base/config.h" "defined(ABSL_CONSUME_DLL)" "1")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/absl/base/internal/thread_identity.h" "defined(ABSL_CONSUME_DLL)" "1")
endif()

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
13 changes: 13 additions & 0 deletions browser/overlay-ports/abseil/use_pthread.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7c82b3a..48474ec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,6 +27,8 @@ project(absl LANGUAGES CXX VERSION 20240722)
set(ABSL_SOVERSION "2407.0.0")
include(CTest)

+add_compile_options(-pthread)
+
# Output directory is correct by default for most build setups. However, when
# building Abseil as a DLL, it is important to have the DLL in the same
# directory as the executable using it. Thus, we put all executables in a single
27 changes: 27 additions & 0 deletions browser/overlay-ports/abseil/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "abseil",
"version": "20240722.0",
"description": [
"Abseil is an open-source collection of C++ library code designed to augment the C++ standard library. The Abseil library code is collected from Google's own C++ code base, has been extensively tested and used in production, and is the same code we depend on in our daily coding lives.",
"In some cases, Abseil provides pieces missing from the C++ standard; in others, Abseil provides alternatives to the standard for special needs we've found through usage in the Google code base. We denote those cases clearly within the library code we provide you.",
"Abseil is not meant to be a competitor to the standard library; we've just found that many of these utilities serve a purpose within our code base, and we now want to provide those resources to the C++ community as a whole."
],
"homepage": "https://github.com/abseil/abseil-cpp",
"license": "Apache-2.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"cxx17": {
"description": "Enable compiler C++17."
}
},
"builtin-baseline":"c82f74667287d3dc386bce81e44964370c91a289"
}
45 changes: 45 additions & 0 deletions browser/overlay-ports/physfs/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO icculus/physfs
REF "release-${VERSION}"
SHA512 e0d84d6ac6bd8f0973149a5add54ed5ed890b5fabb4592ba61b59a3b3e01c05e05f1754f18d7a1c8d72e68777a23cda0c50dc0512cf57a8310a950bf908f54b1
PATCHES
use_pthread.patch
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" PHYSFS_STATIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" PHYSFS_SHARED)

set(generator_param "")
if(VCPKG_TARGET_IS_UWP)
set(generator_param WINDOWS_USE_MSBUILD)
endif()

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
${generator_param}
OPTIONS
-DPHYSFS_BUILD_STATIC=${PHYSFS_STATIC}
-DPHYSFS_BUILD_SHARED=${PHYSFS_SHARED}
-DPHYSFS_BUILD_TEST=OFF
-DPHYSFS_BUILD_DOCS=OFF
)

vcpkg_cmake_install()
vcpkg_copy_pdbs()

vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/PhysFS)
vcpkg_fixup_pkgconfig()

if(PHYSFS_STATIC)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/physfs.h" "defined(PHYSFS_STATIC)" "1")
else()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/physfs.h" "dllexport" "dllimport")
endif()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
10 changes: 10 additions & 0 deletions browser/overlay-ports/physfs/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
physfs provides CMake targets:

find_package(PhysFS CONFIG REQUIRED)
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:PhysFS::PhysFS>,PhysFS::PhysFS,PhysFS::PhysFS-static>)

physfs is compatible with built-in CMake targets:

find_package(PhysFS REQUIRED)
target_include_directories(main PRIVATE ${PHYSFS_INCLUDE_DIR})
target_link_libraries(main PRIVATE ${PHYSFS_LIBRARY})
13 changes: 13 additions & 0 deletions browser/overlay-ports/physfs/use_pthread.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b3291cc..a5d8225 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,6 +25,8 @@ set(PHYSFS_CPP_SRCS)

# I hate that they define "WIN32" ... we're about to move to Win64...I hope!

+add_compile_options(-pthread)
+
if(APPLE)
set(OTHER_LDFLAGS ${OTHER_LDFLAGS} "-framework IOKit -framework Foundation")
list(APPEND PHYSFS_M_SRCS src/physfs_platform_apple.m)
6 changes: 6 additions & 0 deletions browser/overlay-ports/physfs/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
find_library(PHYSFS_LIBRARY_RELEASE NAMES physfs physfs-static NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH)
find_library(PHYSFS_LIBRARY_DEBUG NAMES physfs physfs-static NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH)
include(SelectLibraryConfigurations)
select_library_configurations(PHYSFS)
unset(PHYSFS_FOUND)
_find_package(${ARGS})
19 changes: 19 additions & 0 deletions browser/overlay-ports/physfs/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "physfs",
"version-semver": "3.2.0",
"port-version": 1,
"description": "a library to provide abstract access to various archives",
"homepage": "https://icculus.org/physfs/",
"license": "Zlib",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"builtin-baseline":"c82f74667287d3dc386bce81e44964370c91a289"
}
22 changes: 22 additions & 0 deletions browser/overlay-ports/protobuf/fix-arm64-msvc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/src/google/protobuf/parse_context.h b/src/google/protobuf/parse_context.h
index df12ee1ab..3eb2e56c7 100644
--- a/src/google/protobuf/parse_context.h
+++ b/src/google/protobuf/parse_context.h
@@ -653,7 +653,7 @@ inline const char* VarintParseSlow(const char* p, uint32_t res, uint64_t* out) {
return tmp.first;
}

-#ifdef __aarch64__
+#if defined(__aarch64__) && !defined(_MSC_VER)
// Generally, speaking, the ARM-optimized Varint decode algorithm is to extract
// and concatenate all potentially valid data bits, compute the actual length
// of the Varint, and mask off the data bits which are not actually part of the
@@ -883,7 +883,7 @@ static const char* VarintParseSlowArm(const char* p, uint64_t* out,

template <typename T>
PROTOBUF_NODISCARD const char* VarintParse(const char* p, T* out) {
-#if defined(__aarch64__) && defined(PROTOBUF_LITTLE_ENDIAN)
+#if defined(__aarch64__) && defined(PROTOBUF_LITTLE_ENDIAN) && !defined(_MSC_VER)
// This optimization is not supported in big endian mode
uint64_t first8;
std::memcpy(&first8, p, sizeof(first8));

This comment was marked as resolved.

Loading
Loading