2016-01-07 08:17:16 -05:00
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
2014-10-30 10:03:30 -04:00
using System.IO ;
namespace UnrealBuildTool.Rules
{
public class SQLiteSupport : ModuleRules
{
public SQLiteSupport ( TargetInfo Target )
{
string PlatformName = "" ;
string ConfigurationName = "" ;
switch ( Target . Platform )
{
case UnrealTargetPlatform . Win32 :
PlatformName = "Win32/" ;
break ;
case UnrealTargetPlatform . Win64 :
PlatformName = "x64/" ;
break ;
2014-12-05 11:08:16 -05:00
case UnrealTargetPlatform . IOS :
2015-12-10 16:56:55 -05:00
case UnrealTargetPlatform . TVOS :
PlatformName = "IOS/" ;
2014-12-05 11:08:16 -05:00
break ;
case UnrealTargetPlatform . Mac :
PlatformName = "Mac/" ;
break ;
case UnrealTargetPlatform . Linux :
PlatformName = "Linux/" ;
break ;
2014-10-30 10:03:30 -04:00
}
switch ( Target . Configuration )
{
case UnrealTargetConfiguration . Debug :
ConfigurationName = "Debug/" ;
break ;
case UnrealTargetConfiguration . DebugGame :
ConfigurationName = "Debug/" ;
break ;
default :
ConfigurationName = "Release/" ;
break ;
}
2015-03-24 04:03:28 -04:00
if ( UnrealBuildTool . RunningRocket ( ) )
{
throw new BuildException ( "This module requires a source code build of the engine from Github. Please refer to the Engine/Source/ThirdParty/sqlite/README.txt file prior to enabling this module." ) ;
}
2014-10-30 10:03:30 -04:00
string LibraryPath = "" + UEBuildConfiguration . UEThirdPartySourceDirectory + "sqlite/lib/" + PlatformName + ConfigurationName ;
2014-12-05 11:08:16 -05:00
string LibraryFilename = Path . Combine ( LibraryPath , "sqlite" + UEBuildPlatform . GetBuildPlatform ( Target . Platform ) . GetBinaryExtension ( UEBuildBinaryType . StaticLibrary ) ) ;
2014-10-30 10:03:30 -04:00
if ( ! File . Exists ( LibraryFilename ) )
{
throw new BuildException ( "Please refer to the Engine/Source/ThirdParty/sqlite/README.txt file prior to enabling this module." ) ;
}
2014-12-02 04:38:06 -05:00
PublicIncludePaths . Add ( UEBuildConfiguration . UEThirdPartySourceDirectory + "sqlite/sqlite/" ) ;
2014-10-30 10:03:30 -04:00
PublicDependencyModuleNames . AddRange (
new string [ ] {
"Core" ,
"DatabaseSupport" ,
}
) ;
// Lib file
PublicLibraryPaths . Add ( LibraryPath ) ;
PublicAdditionalLibraries . Add ( LibraryFilename ) ;
}
}
}