From a5c0b4e5539f81ccf5ba57d09299d5030c6c3092 Mon Sep 17 00:00:00 2001 From: HyeonCheol Cho Date: Fri, 3 May 2019 20:50:50 +0900 Subject: [PATCH] fix Library Include --- Source/V8/V8.Build.cs | 137 +++++++++++++++++++++--------------------- 1 file changed, 68 insertions(+), 69 deletions(-) diff --git a/Source/V8/V8.Build.cs b/Source/V8/V8.Build.cs index 9fa94160..4fb4811b 100644 --- a/Source/V8/V8.Build.cs +++ b/Source/V8/V8.Build.cs @@ -143,102 +143,101 @@ private bool LoadV8(ReadOnlyTargetRules Target) } else if (Target.Platform == UnrealTargetPlatform.Android) { - string LibrariesPath = Path.Combine(ThirdPartyPath, "v8", "lib", "Android"); - PublicLibraryPaths.Add(Path.Combine(LibrariesPath, "ARMv7")); - PublicLibraryPaths.Add(Path.Combine(LibrariesPath, "ARM64")); - PublicLibraryPaths.Add(Path.Combine(LibrariesPath, "x86")); - PublicLibraryPaths.Add(Path.Combine(LibrariesPath, "x64")); - - PublicAdditionalLibraries.Add("v8_base"); - PublicAdditionalLibraries.Add("v8_libbase"); - PublicAdditionalLibraries.Add("v8_libplatform"); - PublicAdditionalLibraries.Add("v8_nosnapshot"); - - if (v8_version[0] >= 6) + string LibrariesPath = Path.Combine(ThirdPartyPath, "v8", "lib", "Android", "ARM64"); + + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_init.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_initializers.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_base.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_libbase.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_libplatform.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_nosnapshot.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_libsampler.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libtorque_base.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libtorque_generated_initializers.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libinspector.a")); + + PublicDefinitions.Add(string.Format("WITH_V8=1")); + + return true; + } + else if (Target.Platform == UnrealTargetPlatform.Linux) + { + string LibrariesPath = Path.Combine(ThirdPartyPath, "v8", "lib", "Linux"); + if (Target.Configuration == UnrealTargetConfiguration.Debug) { - if (v8_version[1] >= 4) - { - PublicAdditionalLibraries.Add("v8_init"); - PublicAdditionalLibraries.Add("v8_initializers"); - } - else - { - PublicAdditionalLibraries.Add("v8_builtins_setup"); - PublicAdditionalLibraries.Add("v8_builtins_generators"); - } + LibrariesPath = Path.Combine(LibrariesPath, "Debug"); } - - if (ShouldLink_libsampler) + else { - PublicAdditionalLibraries.Add("v8_libsampler"); + LibrariesPath = Path.Combine(LibrariesPath, "Release"); } + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_init.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_initializers.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_base.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_libbase.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_libplatform.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_nosnapshot.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_libsampler.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libtorque_base.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libtorque_generated_initializers.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libinspector.a")); + PublicDefinitions.Add(string.Format("WITH_V8=1")); return true; } - else if (Target.Platform == UnrealTargetPlatform.Linux) + else if (Target.Platform == UnrealTargetPlatform.Mac) { - string LibrariesPath = Path.Combine(ThirdPartyPath, "v8", "lib", "Linux"); - PublicLibraryPaths.Add(Path.Combine(LibrariesPath, "x64")); - - PublicAdditionalLibraries.Add("v8_base"); - PublicAdditionalLibraries.Add("v8_libbase"); - PublicAdditionalLibraries.Add("v8_libplatform"); - PublicAdditionalLibraries.Add("v8_nosnapshot"); + string LibrariesPath = Path.Combine(ThirdPartyPath, "v8", "lib", "Mac"); - if (v8_version[0] >= 6) + if (Target.Configuration == UnrealTargetConfiguration.Debug) { - if (v8_version[1] >= 4) - { - PublicAdditionalLibraries.Add("v8_init"); - PublicAdditionalLibraries.Add("v8_initializers"); - } - else - { - PublicAdditionalLibraries.Add("v8_builtins_setup"); - PublicAdditionalLibraries.Add("v8_builtins_generators"); - } + LibrariesPath = Path.Combine(LibrariesPath, "Debug"); } - - if (ShouldLink_libsampler) + else { - PublicAdditionalLibraries.Add("v8_libsampler"); + LibrariesPath = Path.Combine(LibrariesPath, "Release"); } + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_init.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_initializers.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_base.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_libbase.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_libplatform.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_nosnapshot.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_libsampler.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libtorque_base.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libtorque_generated_initializers.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libinspector.a")); + PublicDefinitions.Add(string.Format("WITH_V8=1")); return true; } - else if (Target.Platform == UnrealTargetPlatform.Mac) + else if (Target.Platform == UnrealTargetPlatform.IOS) { - string LibrariesPath = Path.Combine(ThirdPartyPath, "v8", "lib", "Mac", "x64"); - PublicLibraryPaths.Add(LibrariesPath); - - PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath,"libv8_base.a")); - PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath,"libv8_libbase.a")); - PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath,"libv8_libplatform.a")); - PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath,"libv8_nosnapshot.a")); + string LibrariesPath = Path.Combine(ThirdPartyPath, "v8", "lib", "IOS"); - if (v8_version[0] >= 6) + if (Target.Configuration == UnrealTargetConfiguration.Debug) { - if (v8_version[1] >= 4) - { - PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath,"libv8_init.a")); - PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath,"libv8_initializers.a")); - } - else - { - PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath,"libv8_builtins_setup.a")); - PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath,"libv8_builtins_generators.a")); - } + LibrariesPath = Path.Combine(LibrariesPath, "Debug"); } - - if (ShouldLink_libsampler) + else { - PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_libsampler.a")); + LibrariesPath = Path.Combine(LibrariesPath, "Release"); } + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_init.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_initializers.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_base.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_libbase.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_libplatform.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_nosnapshot.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libv8_libsampler.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libtorque_generated_initializers.a")); + PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libinspector.a")); + PublicDefinitions.Add(string.Format("WITH_V8=1")); return true;