@@ -186,13 +186,14 @@ private static void LocalProcessOutput(object Sender, DataReceivedEventArgs Args
186
186
public virtual void ApplyToModule ( CleverAdsSolutions Module , ReadOnlyTargetRules Target )
187
187
{
188
188
// module.ModuleDirectory = Plugins/CleverAdsSolutions/Source/CleverAdsSolutions
189
+ string ModuleDirectory = Module . ModuleDirectory ;
189
190
PlatformName = Target . Platform . ToString ( ) ;
190
191
LogDebug ( PlatformName + " Plugin build configuration" ) ;
191
- NativeDir = new DirectoryReference ( Path . Combine ( Module . ModuleDirectory , ".." , "ThirdParty" , PlatformName ) ) ;
192
+ NativeDir = new DirectoryReference ( Path . Combine ( ModuleDirectory , ".." , "ThirdParty" , PlatformName ) ) ;
192
193
ShippingMode = Target . Configuration == UnrealTargetConfiguration . Shipping ;
193
194
194
195
string UPLFileName = "CAS_UPL_" + PlatformName + ".xml" ;
195
- string UPLFilePath = Path . Combine ( Module . ModuleDirectory , UPLFileName ) ;
196
+ string UPLFilePath = Path . Combine ( ModuleDirectory , UPLFileName ) ;
196
197
if ( ! File . Exists ( UPLFilePath ) )
197
198
LostRequiredFile ( UPLFilePath ) ;
198
199
@@ -201,11 +202,29 @@ public virtual void ApplyToModule(CleverAdsSolutions Module, ReadOnlyTargetRules
201
202
LostRequiredFile ( MediationListFile . FullName ) ;
202
203
203
204
Module . PublicDefinitions . Add ( "WITH_CAS=1" ) ;
204
- string ModuleDirectoryRelative = Utils . MakePathRelativeTo ( Module . ModuleDirectory , Target . RelativeEnginePath ) ;
205
+
206
+ string ModuleDirectoryRelative = Utils . MakePathRelativeTo ( ModuleDirectory , Target . RelativeEnginePath ) ;
205
207
string ModuleDirectoryRelativeUPLFilePath = Path . Combine ( ModuleDirectoryRelative , UPLFileName ) ;
206
208
LogDebug ( "Apply UPL: " + ModuleDirectoryRelativeUPLFilePath ) ;
207
209
Module . AdditionalPropertiesForReceipt . Add ( PlatformName + "Plugin" , ModuleDirectoryRelativeUPLFilePath ) ;
208
210
211
+ // When building an application on a Windows machine,
212
+ // it is crucial to ensure that your project folder is located on the same drive
213
+ // as the Unreal Engine installation directory. (e.g., both on C: or both on D:)
214
+ if ( ModuleDirectory [ 1 ] == ':' && ModuleDirectory [ 0 ] != Module . EngineDirectory [ 0 ] )
215
+ {
216
+ string ErrorMessage = "The project folder msut be located on the same drive (" +
217
+ Module . EngineDirectory [ 0 ] + ":) as the Unreal Engine installation directory: " +
218
+ Module . EngineDirectory ;
219
+ if ( ShippingMode )
220
+ {
221
+ CancelBuild ( ErrorMessage ) ;
222
+ }
223
+ else
224
+ {
225
+ LogWarning ( ErrorMessage ) ;
226
+ }
227
+ }
209
228
210
229
JsonObject ConfigJson = JsonObject . Read ( MediationListFile ) ;
211
230
Version = ConfigJson . GetStringField ( "version" ) ;
@@ -491,7 +510,7 @@ public override void ApplyToModule(CleverAdsSolutions Module, ReadOnlyTargetRule
491
510
if ( FileReference . Exists ( CacheConfigFile ) )
492
511
{
493
512
var ConfigFilePathForBuild = CacheConfigFile . ChangeExtension ( null ) ;
494
- FileUtils . ForceMoveFile ( CacheConfigFile , ConfigFilePathForBuild ) ;
513
+ FileReference . Copy ( CacheConfigFile , ConfigFilePathForBuild , true ) ;
495
514
Module . AdditionalBundleResources . Add ( new BundleResource ( ConfigFilePathForBuild . FullName ) ) ;
496
515
}
497
516
0 commit comments