Last active
June 30, 2019 23:00
-
-
Save garyttierney/f565a959101d68e24d667c43eeb714dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From f2a432127b7f33414f78f6c480c4ad3b1d35cb96 Mon Sep 17 00:00:00 2001 | |
| From: Gary Tierney <[email protected]> | |
| Date: Sun, 30 Jun 2019 23:58:35 +0100 | |
| Subject: [PATCH] Fix name of net bindings library under Linux | |
| Also removes an unnecessary preprocessor directive, since the same | |
| library name is passed to `DllImport` under both Linux and Windows. | |
| --- | |
| network.bindings/Makefile | 8 ++++---- | |
| network.bindings/source/network.bindings.cs | 4 +--- | |
| 2 files changed, 5 insertions(+), 7 deletions(-) | |
| diff --git a/network.bindings/Makefile b/network.bindings/Makefile | |
| index 4482013..cc191a4 100644 | |
| --- a/network.bindings/Makefile | |
| +++ b/network.bindings/Makefile | |
| @@ -13,12 +13,12 @@ NATIVE_FLAGSR := -Wall -Wextra -g | |
| LINUX_NATIVE_FLAGS := -fPIC | |
| MAC_LINKER_FLAGS := -bundle | |
| -LINUX_LINKER_FLAGS := -shared -Wl,-soname,libnetwork.bindings.so | |
| +LINUX_LINKER_FLAGS := -shared -Wl,-soname,libnetwork-bindings.so | |
| OS_TYPE := $(shell uname) | |
| # ============================================================================= | |
| -all: createdirs network.bindings | |
| +all: createdirs network-bindings | |
| createdirs: | |
| @if [ ! -d $(BIN_DIR) ];then mkdir $(BIN_DIR);fi | |
| @@ -53,7 +53,7 @@ $(NETWORK_BINDINGS_OBJ_DIR)/driver.o: $(NETWORK_BINDINGS_SRC_DIR)/driver/driver. | |
| # ============================================================================= | |
| -network.bindings: $(NATIVE_OBJS) | |
| +network-bindings: $(NATIVE_OBJS) | |
| ifeq ($(OS_TYPE),Linux) | |
| $(NATIVE_CC) $(NATIVE_FLAGS) $(LINUX_LINKER_FLAGS) $^ -o $(BIN_DIR)/[email protected] | |
| else | |
| @@ -70,7 +70,7 @@ driver: $(DRIVER_OBJS) | |
| install: | |
| #./install_lib.sh libgamesocket.native.dylib | |
| mkdir -p $(UNITY_PROJECT_BINDINGS_DIR) | |
| - cp $(BIN_DIR)/*network.bindings.* $(UNITY_PROJECT_BINDINGS_DIR) | |
| + cp $(BIN_DIR)/*network-bindings.* $(UNITY_PROJECT_BINDINGS_DIR) | |
| cp $(NETWORK_BINDINGS_SRC_DIR)/network.bindings.cs $(UNITY_PROJECT_BINDINGS_DIR) | |
| cp $(NETWORK_BINDINGS_SRC_DIR)/network.bindings.cs.meta $(UNITY_PROJECT_BINDINGS_DIR) | |
| cp $(NETWORK_BINDINGS_SRC_DIR)/network.bindings.bundle.meta $(UNITY_PROJECT_BINDINGS_DIR) | |
| diff --git a/network.bindings/source/network.bindings.cs b/network.bindings/source/network.bindings.cs | |
| index c7213c4..611c422 100644 | |
| --- a/network.bindings/source/network.bindings.cs | |
| +++ b/network.bindings/source/network.bindings.cs | |
| @@ -73,12 +73,10 @@ namespace Unity.Networking.Transport | |
| { | |
| #if UNITY_IOS && !UNITY_EDITOR | |
| const string m_DllName = "__Internal"; | |
| -#elif UNITY_EDITOR_WIN && UNITY_2019_2_OR_NEWER | |
| - const string m_DllName = "network.bindings.dll"; | |
| #elif UNITY_EDITOR_OSX && UNITY_2019_2_OR_NEWER | |
| const string m_DllName = "network.bindings.bundle"; | |
| #else | |
| - const string m_DllName = "network.bindings"; | |
| + const string m_DllName = "network-bindings"; | |
| #endif | |
| [DllImport(m_DllName, CallingConvention = CallingConvention.Cdecl)] | |
| public static extern int network_initialize(); | |
| -- | |
| 2.20.1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment