Skip to content

Commit c4f900a

Browse files
committed
feat: Put the more complicated aspects of the prebuild into a prebuild powershell script, implemented steam integration at the native layer, and updated the binaries.
1 parent 6591de1 commit c4f900a

File tree

8 files changed

+65
-21
lines changed

8 files changed

+65
-21
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:52a3eb89f83ef7b4c9f5778cda651d57c9e991ffadf9dfc2ac27815f93e96aaf
2+
oid sha256:289abdcf9b70e7b16e4e5a6f343bb57f1fc8029f6fef0440ec5a00e9a219cadf
33
size 122880
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:a312eb5588ecde5e82b4a6cc572fda32813ca09b0c8dc6cfeacf46b029ee161d
2+
oid sha256:79a511b125f063220d067262b3386724505a714138315ac4685b5ea4ed67a30c
33
size 603648
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:3cb9944297474f09fbab125aa7650d4f493b668c635da4eab0f5a8b0ad5e1482
2+
oid sha256:0e8b946198fb06daf11bdde1d608b5ec527b84d17f6956a88ce1eb41aa788520
33
size 87040
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:aee2e3184efe8305ea97f61d80c16b168d90564e10846e7e3c3dd4e7b132345f
2+
oid sha256:e80c3babdc4090cb716d88ac36e979fbacf8f67fa668530724d7252cb20639ae
33
size 466944

lib/NativeCode/DynamicLibraryLoaderHelper/Directory.Build.props

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
<NormalizedPlatform Condition="'$(Platform)' == 'x86' or '$(Platform)' == 'Win32'">x86</NormalizedPlatform>
1616
<NormalizedPlatform Condition="'$(Platform)' == 'x64'">x64</NormalizedPlatform>
1717

18-
<!--
18+
<EOS_SDK_DLL_NAME Condition="'$(NormalizedPlatform)' == 'x64'">EOSSDK-Win64-Shipping.dll</EOS_SDK_DLL_NAME>
19+
<STEAM_API_DLL_NAME Condition="'$(NormalizedPlatform)' == 'x64'">steam_api64.dll</STEAM_API_DLL_NAME>
20+
21+
<EOS_SDK_DLL_NAME Condition="'$(NormalizedPlatform)' == 'x86'">EOSSDK-Win32-Shipping.dll</EOS_SDK_DLL_NAME>
22+
<STEAM_API_DLL_NAME Condition="'$(NormalizedPlatform)' == 'x86'">steam_api.dll</STEAM_API_DLL_NAME>
23+
24+
<!--
1925
Define a property with the SolutionDir path but with backslashes replaced
2026
by forward slashes
2127
-->

lib/NativeCode/DynamicLibraryLoaderHelper/NativeRender/NativeRender.vcxproj

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,8 @@
8181
<PreprocessorDefinitions>PEW_EOS_EXPORT;OVERLAY_DLL_NAME="$(OverlayDllName)";STEAM_API_DLL="$(SteamApiDll)";SDK_DLL_NAME="$(SdkDllName)";CONFIG_DIRECTORY="$(ConfigDirectory)";_DEBUG;NATIVERENDER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
8282
</ClCompile>
8383
<PreBuildEvent>
84-
<!-- When debugging, make sure to copy the EOSSDK Dll to the output directory -->
85-
<Command>
86-
@echo Copying "$(OutputUnityAssetsDirectory)$(SdkDllName)" to "$(TargetDir)"
87-
copy "$(OutputUnityAssetsDirectory)$(SdkDllName)" "$(TargetDir)" /Y
88-
89-
@echo Copying "$(SteamLibraryDirectory)steam_api*.dll" to "$(TargetDir)"
90-
powershell -NoProfile -ExecutionPolicy Bypass -Command "try { Get-ChildItem -Path '$(SteamLibraryDirectory)steam_api*.dll' -Recurse | Copy-Item -Destination '$(TargetDir)' -Force } catch { Write-Error $_; exit 1 }"
91-
92-
@echo Copying "$(SolutionDirForwardSlashes)../../../steam_appid.txt" "$(TargetDir)"
93-
xcopy "$(SolutionDirForwardSlashes)../../../steam_appid.txt" "$(TargetDir)" /Y
94-
</Command>
84+
<!-- Execute the prebuild powershell command -->
85+
<Command>powershell -NoProfile -ExecutionPolicy Bypass -File "$(ProjectDir)scripts\prebuild.ps1" -Configuration "$(Configuration)" -NormalizedPlatform "$(NormalizedPlatform)" -OutputUnityAssetsDirectory "$(OutputUnityAssetsDirectory)" -EOS_SDK_DLL_NAME "$(EOS_SDK_DLL_NAME)" -STEAM_API_DLL_NAME "$(STEAM_API_DLL_NAME)" -TargetDir $(TargetDir) -SteamLibraryDirectory "$(SteamLibraryDirectory)" -SolutionDir "$(SolutionDir)"</Command>
9586
</PreBuildEvent>
9687
<PostBuildEvent>
9788
<!-- Copy the meta file stored in the solution directory, since it's values have been properly set in such a way that Unity interacts with the DLL in the intended manner. -->

lib/NativeCode/DynamicLibraryLoaderHelper/NativeRender/include/Config/SteamConfig.hpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,16 @@ namespace pew::eos::config
114114
{
115115
if (name == "overrideLibraryPath")
116116
{
117-
const char* path = json_value_as_string(&value)->string;
118-
if (!string_helpers::is_empty_or_whitespace(path))
119-
{
120-
_library_path = path;
121-
}
117+
const auto override_library_path_element = json_value_as_string(&value);
118+
if (override_library_path_element == nullptr)
119+
{
120+
return;
121+
}
122+
const char* path = override_library_path_element->string;
123+
if (!string_helpers::is_empty_or_whitespace(path))
124+
{
125+
_library_path = path;
126+
}
122127
}
123128
else if (name == "steamSDKMajorVersion")
124129
{
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
param(
2+
[string]$Configuration,
3+
[string]$NormalizedPlatform,
4+
[string]$OutputUnityAssetsDirectory,
5+
[string]$EOS_SDK_DLL_NAME,
6+
[string]$STEAM_API_DLL_NAME,
7+
[string]$TargetDir,
8+
[string]$SteamLibraryDirectory,
9+
[string]$SolutionDir
10+
)
11+
12+
Write-Host "=============== Start of Prebuild Script =========================="
13+
14+
Write-Host "Configuration: $Configuration"
15+
Write-Host "NormalizedPlatform: $NormalizedPlatform"
16+
Write-Host "OutputUnityAssetsDirectory: $OutputUnityAssetsDirectory"
17+
Write-Host "EOS_SDK_DLL_NAME: $EOS_SDK_DLL_NAME"
18+
Write-Host "STEAM_API_DLL_NAME: $STEAM_API_DLL_NAME"
19+
Write-Host "TargetDir: $TargetDir"
20+
Write-Host "SteamLibraryDirectory: $SteamLibraryDirectory"
21+
Write-Host "SolutionDir: $SolutionDir"
22+
23+
# If in debug mode, we want to copy the eos sdk dll, the steam app id file, and
24+
# The steam DLL into the output directory
25+
if ($Configuration -eq "Debug")
26+
{
27+
$filesToCopy = @(
28+
(Join-Path $SolutionDir "..\..\..\steam_appid.txt"),
29+
(Join-Path $SteamLibraryDirectory $STEAM_API_DLL_NAME),
30+
(Join-Path $OutputUnityAssetsDirectory $EOS_SDK_DLL_NAME)
31+
)
32+
33+
$filesToCopy | ForEach-Object {
34+
$itemBeingCopied = Get-Item $_;
35+
36+
Write-Host ('Copying file "{0}" to "{1}".' -f $itemBeingCopied.FullName, $TargetDir);
37+
38+
Copy-Item -LiteralPath $itemBeingCopied.FullName -Destination $TargetDir;
39+
}
40+
}
41+
42+
Write-Host "=============== End of Prebuild Script =========================="

0 commit comments

Comments
 (0)