initial public release
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2022 SenseGlove
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* @section DESCRIPTION
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "SGConnectImpl/SGConnectImpl.h"
|
||||
#include <string>
|
||||
#include "SGBuildHacks/SGInclude_Connect_SGConnect.h"
|
||||
|
||||
int32 FSGConnectImpl::Init()
|
||||
{
|
||||
return SGConnect::Init();
|
||||
}
|
||||
|
||||
int32 FSGConnectImpl::Dispose()
|
||||
{
|
||||
return SGConnect::Dispose();
|
||||
}
|
||||
|
||||
FString FSGConnectImpl::GetLibraryVersion()
|
||||
{
|
||||
std::string version;
|
||||
SGConnect::GetLibraryVersion(&version);
|
||||
return UTF8_TO_TCHAR(version.c_str());
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2022 SenseGlove
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* @section DESCRIPTION
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "SGConnectImpl/SGExportedFunctions.h"
|
||||
#include "Templates/UnrealTemplate.h"
|
||||
#include "SGConnectImpl/SGConnectImpl.h"
|
||||
#include "SGInterop/SGIC_FString.h"
|
||||
|
||||
int32 SGConnect_Init()
|
||||
{
|
||||
return FSGConnectImpl::Init();
|
||||
}
|
||||
|
||||
int32 SGConnect_Dispose()
|
||||
{
|
||||
return FSGConnectImpl::Dispose();
|
||||
}
|
||||
|
||||
void SGConnect_GetLibraryVersion(void* OutVersion)
|
||||
{
|
||||
StaticCast<FSGIC_FString*>(OutVersion)->String = FSGConnectImpl::GetLibraryVersion();
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2022 SenseGlove
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* @section DESCRIPTION
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "SenseGloveConnectImpl.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
#include "SenseGloveConnectImplModule.h"
|
||||
|
||||
IMPLEMENT_MODULE(FSenseGloveConnectImplModule, SenseGloveConnectImpl)
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2022 SenseGlove
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* @section DESCRIPTION
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2022 SenseGlove
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* @section DESCRIPTION
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "SenseGloveConnectImplModule.h"
|
||||
#include "Containers/UnrealString.h"
|
||||
#include "SGConnectImpl/SGConnectImpl.h"
|
||||
#include "SGLog/SGLog.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "FSenseGloveConnectImplModule"
|
||||
|
||||
void FSenseGloveConnectImplModule::StartupModule()
|
||||
{
|
||||
SGLOG("Starting up SenseGloveConnectImpl module...");
|
||||
SGLOG(FString::Printf(TEXT("The low-level implementation of '%s' has been loaded successfully!"), *FSGConnectImpl::
|
||||
GetLibraryVersion()));
|
||||
}
|
||||
|
||||
void FSenseGloveConnectImplModule::PreUnloadCallback()
|
||||
{
|
||||
SGLOG("Unloading SenseGloveConnectImpl module...");
|
||||
}
|
||||
|
||||
void FSenseGloveConnectImplModule::PostLoadCallback()
|
||||
{
|
||||
SGLOG("Loading of SenseGloveConnectImpl module has succeeded!");
|
||||
}
|
||||
|
||||
void FSenseGloveConnectImplModule::ShutdownModule()
|
||||
{
|
||||
SGLOG("Shutting down SenseGloveConnectImpl module...");
|
||||
}
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2022 SenseGlove
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* @section DESCRIPTION
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Modules/ModuleInterface.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "SenseGloveConnectImpl"
|
||||
|
||||
class FSenseGloveConnectImplModule : public IModuleInterface
|
||||
{
|
||||
public:
|
||||
virtual void StartupModule() override;
|
||||
virtual void PreUnloadCallback() override;
|
||||
virtual void PostLoadCallback() override;
|
||||
virtual void ShutdownModule() override;
|
||||
};
|
||||
|
||||
#undef LOCTEXT_NAMESPACE
|
||||
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2022 SenseGlove
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* @section DESCRIPTION
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Containers/UnrealString.h"
|
||||
|
||||
class SENSEGLOVECONNECTIMPL_API FSGConnectImpl
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Begin Scanning for Sense Glove Devices and set up communications with them.
|
||||
*
|
||||
* @return
|
||||
* -3 : An Unexpected error occured. Please try again.
|
||||
* -2 : Device Scanning is already running within a different program.
|
||||
* -1 : Device Scanning already being initialized (function called twice in short succession).
|
||||
* 0 : Device Scanning is already running in within this program.
|
||||
* 1 : Successfully started up DeviceScanning from the current program.
|
||||
*/
|
||||
static int32 Init();
|
||||
|
||||
/**
|
||||
* Dispose of unmanaged resources and finalize Sense Glove devices.
|
||||
*
|
||||
* @return
|
||||
* -3 : An Unexpected error occured. Please try again.
|
||||
* -2 : Not allowed to dispose of Device Scanning because this is not the program which started it.
|
||||
* -1 : Device Scanning is currently being disposed off. This takes a second or two. (function called twice in short succession).
|
||||
* 0 : There is no deviceScanner running from any program, so disposing is skipped.
|
||||
* 1 : Successfully disposed of DeviceScanner resources.
|
||||
* @remark If the Dispose function returns 1, the resources were neatly disposed of. Only a value of -3 is cause for concern.
|
||||
*/
|
||||
static int32 Dispose();
|
||||
|
||||
/**
|
||||
* Check which version of SGConnect you are using.
|
||||
*/
|
||||
static FString GetLibraryVersion();
|
||||
};
|
||||
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2022 SenseGlove
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* @section DESCRIPTION
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
/* Defines a C++ like static_assert. */
|
||||
#if __cplusplus
|
||||
#include <cassert>
|
||||
#else
|
||||
#include <assert.h>
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Contains __bool_true_false_are_defined macro that can be used in order to
|
||||
check whether boolean type is supported by the compiler or not. */
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <CoreTypes.h>
|
||||
|
||||
/* Check at compile time whether the C compiler has support for bool, true,
|
||||
and false macros. */
|
||||
static_assert(__bool_true_false_are_defined, "Error: bool, true, and false are not defined!");
|
||||
|
||||
#if defined ( SENSEGLOVE_BUILDING_CONNECT_IMPL_MODULE )
|
||||
#define SENSEGLOVECONNECTIMPL_PUBLIC_API DLLEXPORT
|
||||
#else
|
||||
#define SENSEGLOVECONNECTIMPL_PUBLIC_API DLLIMPORT
|
||||
#endif /* defined ( SENSEGLOVE_BUILDING_CONNECT_IMPL_MODULE ) */
|
||||
|
||||
/* If C++ is used, switch to C mode in order to prevent C++'s name mangling of
|
||||
method names. */
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* SGConnect.h */
|
||||
SENSEGLOVECONNECTIMPL_PUBLIC_API int32 SGConnect_Init();
|
||||
SENSEGLOVECONNECTIMPL_PUBLIC_API int32 SGConnect_Dispose();
|
||||
SENSEGLOVECONNECTIMPL_PUBLIC_API void SGConnect_GetLibraryVersion(void* OutVersion);
|
||||
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
@@ -0,0 +1,251 @@
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @author Mamadou Babaei <mamadou@senseglove.com>
|
||||
*
|
||||
* @section LICENSE
|
||||
*
|
||||
* (The MIT License)
|
||||
*
|
||||
* Copyright (c) 2020 - 2022 SenseGlove
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* @section DESCRIPTION
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using UnrealBuildTool;
|
||||
|
||||
public class SenseGloveConnectImpl : ModuleRules
|
||||
{
|
||||
public SenseGloveConnectImpl(ReadOnlyTargetRules Target) : base(Target)
|
||||
{
|
||||
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||
|
||||
bEnableExceptions = true;
|
||||
bUseRTTI = true;
|
||||
|
||||
PublicDependencyModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"Core",
|
||||
}
|
||||
);
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"SenseGloveBuildHacks",
|
||||
"SenseGloveInterop",
|
||||
"SenseGloveLog",
|
||||
"SenseGloveTypes",
|
||||
"SenseGloveUtils",
|
||||
}
|
||||
);
|
||||
|
||||
AddConnectLibrary(Target);
|
||||
AddSerialLibrary(Target);
|
||||
|
||||
PublicDefinitions.Add("SENSEGLOVE_BUILDING_CONNECT_IMPL_MODULE");
|
||||
PublicDefinitions.Add("SENSEGLOVE_UNREAL_ENGINE_PLUGIN");
|
||||
}
|
||||
|
||||
private void AddConnectLibrary(ReadOnlyTargetRules Target)
|
||||
{
|
||||
string PluginRootDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", ".."));
|
||||
string ThirdPartyDirectory = Path.GetFullPath(Path.Combine(PluginRootDirectory, "ThirdParty"));
|
||||
string LibraryPath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "lib"));
|
||||
string LibraryName = "sgconnect";
|
||||
|
||||
if (Target.Platform == UnrealTargetPlatform.Android)
|
||||
{
|
||||
IAndroidToolChain ToolChain = AndroidExports.CreateToolChain(Target.ProjectFile);
|
||||
List<string> Architectures = ToolChain.GetAllArchitectures();
|
||||
foreach (string Arch in Architectures)
|
||||
{
|
||||
if (Arch != "-arm64")
|
||||
{
|
||||
Debug.Assert(false, "Only AArch64/ARM64 variant of Android is supported!");
|
||||
}
|
||||
}
|
||||
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "oculus"));
|
||||
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||
}
|
||||
else if (Target.Platform == UnrealTargetPlatform.Linux)
|
||||
{
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||
|
||||
#if UE_5_0_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v20"));
|
||||
#elif UE_4_27_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v19"));
|
||||
#elif UE_4_26_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v17"));
|
||||
#elif UE_4_25_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v16"));
|
||||
#elif UE_4_24_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v15"));
|
||||
#elif UE_4_23_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v15"));
|
||||
#elif UE_4_22_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v13"));
|
||||
#else
|
||||
Debug.Assert(false, "Unsupported compiler!");
|
||||
#endif
|
||||
}
|
||||
else if (Target.Platform == UnrealTargetPlatform.Win64)
|
||||
{
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "win64"));
|
||||
switch (Target.WindowsPlatform.Compiler)
|
||||
{
|
||||
#if UE_4_27_OR_LATER
|
||||
case WindowsCompiler.VisualStudio2022:
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc143"));
|
||||
break;
|
||||
#endif
|
||||
#if UE_4_22_OR_LATER
|
||||
case WindowsCompiler.VisualStudio2019:
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142"));
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
Debug.Assert(false, "Unsupported compiler!");
|
||||
break;
|
||||
}
|
||||
LibraryName = string.Format("{0}.lib", LibraryName);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Assert(false, "Unsupported platform!");
|
||||
}
|
||||
|
||||
bool bDebug = (Target.Configuration == UnrealTargetConfiguration.Debug);
|
||||
if (bDebug)
|
||||
{
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "debug"));
|
||||
}
|
||||
else
|
||||
{
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "release"));
|
||||
}
|
||||
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, LibraryName));
|
||||
string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include"));
|
||||
|
||||
PrivateIncludePaths.Add(IncludePath);
|
||||
PublicAdditionalLibraries.Add(LibraryPath);
|
||||
}
|
||||
|
||||
private void AddSerialLibrary(ReadOnlyTargetRules Target)
|
||||
{
|
||||
string PluginRootDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", ".."));
|
||||
string ThirdPartyDirectory = Path.GetFullPath(Path.Combine(PluginRootDirectory, "ThirdParty"));
|
||||
string LibraryPath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "lib"));
|
||||
string LibraryName = "serial";
|
||||
|
||||
if (Target.Platform == UnrealTargetPlatform.Android)
|
||||
{
|
||||
IAndroidToolChain ToolChain = AndroidExports.CreateToolChain(Target.ProjectFile);
|
||||
List<string> Architectures = ToolChain.GetAllArchitectures();
|
||||
foreach (string Arch in Architectures)
|
||||
{
|
||||
if (Arch != "-arm64")
|
||||
{
|
||||
Debug.Assert(false, "Only AArch64/ARM64 variant of Android is supported!");
|
||||
}
|
||||
}
|
||||
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "oculus"));
|
||||
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||
}
|
||||
else if (Target.Platform == UnrealTargetPlatform.Linux)
|
||||
{
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
|
||||
LibraryName = string.Format("lib{0}.a", LibraryName);
|
||||
|
||||
#if UE_5_0_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v20"));
|
||||
#elif UE_4_27_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v19"));
|
||||
#elif UE_4_26_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v17"));
|
||||
#elif UE_4_25_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v16"));
|
||||
#elif UE_4_24_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v15"));
|
||||
#elif UE_4_23_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v15"));
|
||||
#elif UE_4_22_OR_LATER
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v13"));
|
||||
#else
|
||||
Debug.Assert(false, "Unsupported compiler!");
|
||||
#endif
|
||||
}
|
||||
else if (Target.Platform == UnrealTargetPlatform.Win64)
|
||||
{
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "win64"));
|
||||
switch (Target.WindowsPlatform.Compiler)
|
||||
{
|
||||
#if UE_4_27_OR_LATER
|
||||
case WindowsCompiler.VisualStudio2022:
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc143"));
|
||||
break;
|
||||
#endif
|
||||
#if UE_4_22_OR_LATER
|
||||
case WindowsCompiler.VisualStudio2019:
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142"));
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
Debug.Assert(false, "Unsupported compiler!");
|
||||
break;
|
||||
}
|
||||
LibraryName = string.Format("{0}.lib", LibraryName);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Assert(false, "Unsupported platform!");
|
||||
}
|
||||
|
||||
bool bDebug = (Target.Configuration == UnrealTargetConfiguration.Debug);
|
||||
if (bDebug)
|
||||
{
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "debug"));
|
||||
}
|
||||
else
|
||||
{
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "release"));
|
||||
}
|
||||
|
||||
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, LibraryName));
|
||||
string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include"));
|
||||
|
||||
PrivateIncludePaths.Add(IncludePath);
|
||||
PublicAdditionalLibraries.Add(LibraryPath);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user