Skip to content

Commit

Permalink
switch to IPV6 singleheader enet fork https://github.com/zpl-c/enet
Browse files Browse the repository at this point in the history
  • Loading branch information
samtupy committed Nov 6, 2024
1 parent 6638726 commit 6327dcd
Show file tree
Hide file tree
Showing 10 changed files with 6,768 additions and 38 deletions.
4 changes: 2 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ if ARGUMENTS.get("debug", "0") == "1":
if env["PLATFORM"] == "win32":
env.Append(CCFLAGS = ["/EHsc", "/J", "/MT", "/Z7", "/std:c++20", "/GF", "/Zc:inline", "/O2", "/bigobj", "/permissive-"])
env.Append(LINKFLAGS = ["/NOEXP", "/NOIMPLIB"], no_import_lib = 1)
env.Append(LIBS = ["UniversalSpeechStatic", "enet", "angelscript64", "SDL3"])
env.Append(LIBS = ["UniversalSpeechStatic", "angelscript64", "SDL3"])
env.Append(LIBS = ["Kernel32", "User32", "imm32", "OneCoreUAP", "dinput8", "dxguid", "gdi32", "winspool", "shell32", "iphlpapi", "ole32", "oleaut32", "delayimp", "uuid", "comdlg32", "advapi32", "netapi32", "winmm", "version", "crypt32", "normaliz", "wldap32", "ws2_32"])
else:
env.Append(CXXFLAGS = ["-fms-extensions", "-std=c++20", "-fpermissive", "-O2", "-Wno-narrowing", "-Wno-int-to-pointer-cast", "-Wno-delete-incomplete", "-Wno-unused-result"], LIBS = ["m"])
if env["PLATFORM"] == "darwin":
# homebrew paths and other libraries/flags for MacOS
env.Append(CCFLAGS = ["-mmacosx-version-min=14.0", "-arch", "arm64", "-arch", "x86_64"], LINKFLAGS = ["-arch", "arm64", "-arch", "x86_64"])
# The following, to say the least, is absolutely not ideal. In some cases we have both static and dynamic libraries on the system and must explicitly choose the static one. The normal :libname.a trick doesn't seem to work on clang, we're just informed that libs couldn't be found. If anybody knows a better way to force static library linkage on MacOS particularly without the absolute paths, please let me know!
env.Append(LIBS = [File("/usr/local/lib/libangelscript.a"), File("/usr/local/lib/libenet.a"), File("/usr/local/lib/libSDL3.a"), File("/usr/local/lib/libcrypto.a"), File("/usr/local/lib/libssl.a"), "iconv"])
env.Append(LIBS = [File("/usr/local/lib/libangelscript.a"), File("/usr/local/lib/libSDL3.a"), File("/usr/local/lib/libcrypto.a"), File("/usr/local/lib/libssl.a"), "iconv"])
elif env["PLATFORM"] == "posix":
# enable the gold linker to silence seemingly pointless warnings about symbols in the bass libraries, strip the resulting binaries, and add /usr/local/lib to the libpath because it seems we aren't finding libraries unless we do manually.
env.Append(CPPPATH = ["/usr/local/include"], LIBPATH = ["/usr/local/lib"], LINKFLAGS = ["-fuse-ld=gold", "-g" if ARGUMENTS.get("debug", 0) == "1" else "-s"])
Expand Down
13 changes: 0 additions & 13 deletions build/build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ function setup_reactphysics {
cd ../..
}

function setup_enet {
echo Installing enet...
git clone --depth 1 https://github.com/lsalzman/enet||true
cd enet
autoreconf -vfi
./configure
make -j$(nproc)
sudo make install
cd ..
echo Enet installed.
}

function setup_libgit2 {
echo Installing libgit2...
curl -s -O -L https://github.com/libgit2/libgit2/archive/refs/tags/v1.8.1.tar.gz
Expand Down Expand Up @@ -138,7 +126,6 @@ function main {

setup_angelscript
setup_reactphysics
setup_enet
setup_libgit2
setup_libplist
setup_poco
Expand Down
13 changes: 0 additions & 13 deletions build/build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,6 @@ function setup_reactphysics {
cd ../..
}

function setup_enet {
echo Installing enet...
git clone --depth 1 https://github.com/lsalzman/enet||true
cd enet
autoreconf -vfi
./configure CC="clang -arch x86_64 -arch arm64" CXX="clang++ -arch x86_64 -arch arm64" CPP="clang -E" CXXCPP="clang++ -E"
make -j$(nsysctl -n hw.ncpu)
sudo make install
cd ..
echo Enet installed.
}

function setup_libgit2 {
curl -s -O -L https://github.com/libgit2/libgit2/archive/refs/tags/v1.8.1.tar.gz
tar -xzf v1.8.1.tar.gz
Expand Down Expand Up @@ -151,7 +139,6 @@ function main {
setup_openssl
setup_angelscript
setup_reactphysics
setup_enet
setup_libgit2
setup_poco
setup_sdl
Expand Down
2 changes: 1 addition & 1 deletion dep/_SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Import("env")

sources = ["aes.c", "cmp.c", "micropather.cpp", "rng_get_bytes.c", "singleheader.cpp", "sonic.c", "tinyexpr.c", "uncompr.c"]
sources = ["aes.c", "cmp.c", "enet_compress.c", "micropather.cpp", "rng_get_bytes.c", "singleheader.cpp", "sonic.c", "tinyexpr.c", "uncompr.c"]
if env["PLATFORM"] == "win32":
sources += ["blastspeak.c", "InputBox.cpp", "vs_version.cpp"]
env.StaticLibrary("#build/lib/deps", sources, CPPDEFINES = ["_LIB"])
Loading

0 comments on commit 6327dcd

Please sign in to comment.