Skip to content

Commit

Permalink
fix building process for Unreal Enigne (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavrax authored Jan 30, 2024
1 parent e06c03e commit 7311ddd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,18 @@ Our repository can be build via two different approaches:

You can build repository using CMake using our [CMakeLists.txt file](CMakeLists.txt).

- Unix:
```sh
mkdir build && cd build
cmake ..
[n]make
make
```

- Windows (MSVS tools required):
```sh
mkdir build && cd build
cmake .. -G "NMake Makefiles"
nmake
```

There are several options to be selected via switches (using GUI) or by using command line.
Expand Down
11 changes: 8 additions & 3 deletions unreal/PubNubModule/PubNubModule.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class PubNubModule : ModuleRules
{
private bool OpenSsl = false;
private bool StaticLink = false;
private string BuildLocation = "";

public PubNubModule(ReadOnlyTargetRules Target) : base(Target)
{
Expand All @@ -31,11 +32,15 @@ public PubNubModule(ReadOnlyTargetRules Target) : base(Target)
PublicDependencyModuleNames.AddRange(new string[] { "OpenSSL" });
}


PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, $"libpubnub.{extention}"));
var path = Path.Combine(new string[] { ModuleDirectory, "..", ".." });
#if PLATFORM_WINDOWS
var binary = pubnub.{extention};
#else
var binary = libpubnub.{extention};
#endif
PublicAdditionalLibraries.Add(Path.Combine(path, BuildLocation, binary));
PublicIncludePaths.AddRange(
new string[] {
path,
Path.Combine(path, "core"),
Path.Combine(path, "lib"),
Path.Combine(path, includeLib)
Expand Down
3 changes: 2 additions & 1 deletion unreal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ C-core offers some customization flags (e.g. shared library or using openssl). Y
cmake . -DSHARED=ON -DOPENSSL=ON -DOPENSSL_ROOT_DIR={unreal engine location}/Engine/Source/ThirdParty/openssl/1.1.1/
```

3. Adjust `PubNubModule/PubNubModule.Build.cs` with selected options by changing `OpenSsl`, `StaticLink` and `LibPath` with the same values you used for compilation.
3. Adjust `PubNubModule/PubNubModule.Build.cs` with selected options by changing `OpenSsl`, `StaticLink` and `BuildLocation` with the same values you used for compilation.

For example:

```csharp
private bool OpenSsl = true;
private bool StaticLink = false;
private string BuildLocation = "build/";
```

4. Finally, import the module into your project as follows:
Expand Down

0 comments on commit 7311ddd

Please sign in to comment.